home *** CD-ROM | disk | FTP | other *** search
/ IBM OEM Software Product … CD For PC Manufacturers / IBM OEM Software - Product Sampler CD for PC Manufacturers.iso / InternetIntranets / Notes / INSTALL1.DSK / NOT.LSS < prev    next >
Text File  |  1997-09-18  |  199KB  |  5,048 lines

  1.  
  2. CONST gDebugNotes%=0                '** 1 for debug information, 0 for none
  3. CONST gDebugGetObs%=0                '** 1 to Debug GetObsolete()
  4. CONST gDebugAddReg=0                '** 1 to Debug AddRegistryKeysNOT()
  5. CONST gDebugNotesFromPath=0         '** 1 to Debug GetNotesFromPAth()
  6. CONST gDebugWriteNotesReg%=0        '** 1 to Debug WriteNotesReg
  7. CONST gDebugInitCopyList%=0            '** 1 to Debug InitCopyList
  8. CONST gDebugPartionedNotesIni%=0            '** 1 to Debug PartionedNotesIni
  9. CONST gDebugPathChangeNot=0            '** 1 to Debug PathChangeNOT
  10. CONST gDebugReadInf=0                '** 1 to Debug ReadInf
  11. CONST gDebugDoesFileExistOnPath=0    '** 1 to Debug DoesFileExistOnPath
  12. CONST gDebugWriteMapi=0                '** 1 to debug WriteMapi
  13. CONST gDebugNotesSingleLogon%=0         '** 1 to debug Notes Single logon
  14. CONST gDebugAddIcons%=0
  15. CONST gDebugPartition%=0
  16. CONST gDebugKittype%=0                    '** 1 to track Kittype Variable
  17. CONST gDebugNotesIni%=0
  18. CONST gDebugNotesInRegistry%=0
  19. CONST gDebugIsNotesOnPath%=0
  20. CONST gDebugNotesFromLotus%=0
  21. CONST gDebugNotesIniFromSessionMgr%=0
  22. CONST gDebugNotesIniFromWinDir%=0
  23. CONST gDebugNotesIniFromPath=0
  24. CONST gDebugNotesPartition%=0
  25. CONST gDebugNotesDataRegistry%=0
  26. CONST gDebugInitNot%=0
  27. CONST gDebugValidateIni%=0
  28. %include "instsize.lss"                '** Size of install for Server and Workstation
  29.  
  30. '/*********************************************************************
  31. ''
  32. ''   Module Name:   NOT.lss
  33. ''
  34. ''   Module Code:   COMINST
  35. ''
  36. ''   Author:              
  37. ''
  38. ''   Creation Date:       Jan 26, 1994
  39. ''
  40. ''   Copyright Lotus Development Corporation, (c) 1994
  41. ''
  42. ''
  43. ''  
  44. ''   Description: 
  45. ''
  46. ''
  47. ''   Additional authors:
  48. ''
  49. ''   Change History:
  50. ''   $Log:   
  51. '' 
  52. ''    Rev 1.52   01 Sep 1995 13:11:38   amontalv
  53. '' Correction to how icons are named.  Had used call to Lot_GetProgFolder, which was
  54. '' only needed when registering the link object.
  55. '' 
  56. ''    Rev 1.51   29 Aug 1995 14:16:52   tveerapp
  57. '' Commented out code to surface default preferences dialog.
  58. '' 
  59. ''    Rev 1.50   28 Aug 1995 16:59:30   tveerapp
  60. '' FIxed the node initcopylist code that turned off sections not installed on
  61. '' the server.
  62. '' 
  63. ''    Rev 1.49   28 Aug 1995 13:41:40   tveerapp
  64. '' No change.
  65. '' 
  66. ''    Rev 1.48   28 Aug 1995 13:40:12   tveerapp
  67. '' Removed the example for registering the Program Group for
  68. '' uninstall. This fixes an spr.
  69. '' 
  70. ''    Rev 1.47   25 Aug 1995 11:27:06   amontalv
  71. '' Made icons in all environments have same name.
  72. '' 
  73. ''    Rev 1.46   24 Aug 1995 10:30:48   jdonohue
  74. '' Added comment about USERDIR
  75. '' 
  76. ''    Rev 1.45   23 Aug 1995 12:26:54   tveerapp
  77. '' Added code to register work, masters and backup directories with the toolkit.
  78. '' 
  79. ''    Rev 1.44   22 Aug 1995 18:24:54   tveerapp
  80. '' Added the callback etc for work, smasters and backup.
  81. '' 
  82. ''    Rev 1.43   22 Aug 1995 15:17:10   jdonohue
  83. '' Do not register the uninstaller for language install
  84. '' 
  85. ''    Rev 1.42   22 Aug 1995 14:03:20   jdonohue
  86. '' Changed GetNOTPathfromLotusIni to check for registry entries
  87. '' Function GetNOTPathfromLotusIni returns path w/o filename now
  88. '' 
  89. ''    Rev 1.41   21 Aug 1995 15:50:54   amontalv
  90. '' Added global for registry entry.
  91. '' 
  92. ''    Rev 1.40   21 Aug 1995 10:23:48   jdonohue
  93. '' Added calls in Init for marking secondary language content directories
  94. '' Moved language directory symbol setting code to InitCopyList
  95. '' 
  96. ''    Rev 1.39   17 Aug 1995 09:34:14   amontalv
  97. '' Had put wrong number of arguments.
  98. '' 
  99. ''    Rev 1.38   16 Aug 1995 20:35:30   amontalv
  100. '' Added some error handling for registry.
  101. '' 
  102. ''    Rev 1.37   15 Aug 1995 11:53:12   jdonohue
  103. '' Removed SYM_INSTALLKIND$ -- in GLOBALS.LSS
  104. '' 
  105. ''    Rev 1.36   09 Aug 1995 09:18:16   jdonohue
  106. '' Don't add language qualifier to icon for first time install
  107. '' 
  108. ''    Rev 1.35   04 Aug 1995 15:53:38   jdonohue
  109. '' Added code to create icons with language switch and sublanguage name appended
  110. '' 
  111. ''    Rev 1.34   02 Aug 1995 16:54:54   jdonohue
  112. '' Changed calling syntax for InitLanguageNOT
  113. '' 
  114. ''    Rev 1.33   31 Jul 1995 16:28:10   pdonahue
  115. '' changed verison number from 2.1 to 0.0. 
  116. '' Changed registry entry for installtype from type REG_SZ to REG_DWORD.
  117. '' 
  118. ''    Rev 1.32   20 Jul 1995 14:20:58   jdonohue
  119. '' Fixed uninstall command line string for language
  120. '' 
  121. ''    Rev 1.31   12 Jul 1995 17:07:18   jdonohue
  122. '' Added comments about language install subdirectories
  123. '' 
  124. ''    Rev 1.30   23 Jun 1995 13:55:56   mzgripce
  125. '' remove autoinst.rsp from the uninstaller registration example
  126. '' 
  127. ''    Rev 1.29   23 Jun 1995 13:24:56   mzgripce
  128. '' added an example for the Program_group class registration
  129. '' 
  130. ''    Rev 1.28   22 Jun 1995 18:38:14   mzgripce
  131. '' register the components that are going with the not product:aswan and its 
  132. '' dependency: LotusScript,Bento and Shared help
  133. '' 
  134. ''    Rev 1.27   21 Jun 1995 18:01:26   mzgripce
  135. '' add examples for the other object clases registration for uninstall
  136. '' 
  137. ''    Rev 1.26   21 Jun 1995 12:48:08   jdonohue
  138. '' SYM_INSTALLKIND global symbol, not product specific
  139. '' 
  140. ''    Rev 1.25   21 Jun 1995 09:09:42   jdonohue
  141. '' Moved AddRegistryLanguage to AddRegistryKeysNOT
  142. '' 
  143. ''    Rev 1.24   19 Jun 1995 17:41:56   mzgripce
  144. '' change the not version to 2.1 and enable the uninstaller registration 
  145. '' 
  146. ''    Rev 1.23   19 Jun 1995 16:53:24   mzgripce
  147. '' add examples calls to Lot_RegisterObject()
  148. '' 
  149. ''    Rev 1.22   16 Jun 1995 17:08:02   pdonahue
  150. '' added registry entries for not.
  151. '' 
  152. ''    Rev 1.21   09 Jun 1995 17:00:58   mzgripce
  153. '' added call example in PostCopyConfig to register the uninstaller
  154. '' 
  155. ''    Rev 1.20   07 Jun 1995 16:32:08   amontalv
  156. '' Changed the Win95 start folder so that it initializes
  157. '' earlier in the program.  This should make automation
  158. '' easier to implement for it.  There are still a couple of
  159. '' bugs that I need to work out, but I feel that I should
  160. '' check what I have now.  I also changed the name of some
  161. '' of the functions to conform more to current names.
  162. '' 
  163. ''    Rev 1.19   01 Jun 1995 14:54:10   amontalv
  164. '' Had the check incorrect for creating links.  It tried to create links
  165. '' when not in Win95 instead of when in Win95.
  166. '' 
  167. ''    Rev 1.18   01 Jun 1995 11:11:52   amontalv
  168. '' Added API function CreateLink to create shortcuts.  Also added functions
  169. '' to save and get the link path to support the CreateLink.  I also changed
  170. '' the startup program folder code to use the default dialog proc and changed
  171. '' the default dialog proc to process directory trees.
  172. '' 
  173. ''    Rev 1.17   30 May 1995 16:01:00   jdonohue
  174. '' Set symbols for product and version for language install
  175. '' 
  176. ''    Rev 1.16   21 May 1995 17:30:24   mzgripce
  177. '' add an example for share32 support 
  178. '' 
  179. ''    Rev 1.15   19 May 1995 15:31:28   mzgripce
  180. '' use the parent dir in the product default destination
  181. '' 
  182. ''    Rev 1.14   19 May 1995 14:42:44   jdonohue
  183. '' Remove redundant symbol for language subdirectory
  184. '' 
  185. ''    Rev 1.13   19 May 1995 13:23:46   jdonohue
  186. '' Added call to Lot_SetLanguageSectionsOn
  187. '' 
  188. ''    Rev 1.12   18 May 1995 15:36:52   jdonohue
  189. '' Added language install code
  190. '' 
  191. ''    Rev 1.11   18 May 1995 10:18:52   jdonohue
  192. '' Added language install function InitLanguage
  193. '' 
  194. ''    Rev 1.9   02 May 1995 12:54:06   cmoy
  195. '' Merged c2 into cf build
  196. '' 
  197. ''    Rev 1.9   10 Apr 1995 18:11:28   amontalv
  198. '' Changed comments to reflect change of function reference.
  199. '' 
  200. ''    Rev 1.8   31 May 1994 13:54:42   mmeth
  201. '' 
  202. '' Added PrevVersionNOT
  203. '' 
  204. ''    Rev 1.7   13 May 1994 14:09:20   thangv
  205. '' 
  206. '' Added the else part to the default code in InitNOT case node.
  207. '' 
  208. ''    Rev 1.6   06 May 1994 09:24:52   mmeth
  209. '' wrong return for function
  210. '' 
  211. ''    Rev 1.5   02 May 1994 19:18:16   mzgripce
  212. '' 
  213. '' add AddIconsNOT
  214. '' 
  215. ''    Rev 1.4   28 Mar 1994 17:25:50   thangv
  216. '' 
  217. '' Resourced strings that were not. SID_NOT_SERVER_DIRNAME, SID_NOT_DIST_DIRNA
  218. '' 
  219. ''    Rev 1.3   22 Mar 1994 09:24:46   mmeth
  220. '' Modified AddTo Billboard List to use IDD_NOTBILLBD1,...
  221. '' 
  222. ''    Rev 1.2   17 Feb 1994 17:44:44   thangv
  223. '' Fixed the trailing \ and NOT_DIR
  224. '' 
  225. ''    Rev 1.1   15 Feb 1994 14:36:20   mmeth
  226. '' moved the EXIT FUNCTION CALL in
  227. '' 
  228. ''    Rev 1.0   11 Feb 1994 10:53:40   jbrodeur
  229. '' Initial Revision
  230. ''----------------------------------------------------------------------
  231. ''   Date     Vers. Pgmr  SPR#  Change
  232. ''----------------------------------------------------------------------
  233. '' !
  234. ''  02-07-94   0000             Initial Product Shipment
  235. ''
  236. ''----------------------------------------------------------------------
  237. ''
  238. ''*********************************************************************/
  239. '**   This file contains detailed comments. PLEASE READ THEM! They provide
  240. '**   information that will make writing Install much easier. In some
  241. '**   cases, you will not find this information in any other sources.
  242. ''*********************************************************************/
  243. '**
  244.  
  245. USE "TOOLKIT"
  246. USE "LANGUAGE"
  247. OPTION DECLARE
  248.  
  249. '** These Are the Required Functions that Products must provide
  250. '***************************************************************
  251. DECLARE PUBLIC FUNCTION ProductRegNOT (prodno%, network$, direction$) AS STRING
  252. DECLARE PUBLIC FUNCTION DefaultUserRegNOT (prodno%, network$, direction$) AS STRING
  253. DECLARE PUBLIC FUNCTION InitNOT (prodno%, network$, direction$, basedir$) AS STRING
  254. DECLARE PUBLIC FUNCTION PrevVersionsNOT (prodno%, network$, direction$) AS STRING
  255. DECLARE PUBLIC FUNCTION PathChangeNOT (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  256. DECLARE PUBLIC FUNCTION InitCopyListNOT (prodno%, network$, direction$) AS STRING
  257. DECLARE PUBLIC FUNCTION PreCopyConfigNOT (prodno%, network$, direction$, lic%) AS STRING
  258. DECLARE PUBLIC FUNCTION AddTheBillBoardsNOT (prodno%, network$, direction$, nbytes&) AS STRING
  259. DECLARE PUBLIC FUNCTION PostCopyConfigNOT (prodno%, network$, direction$, programgroup$) AS STRING
  260. DECLARE PUBLIC FUNCTION AddIconsNOT (prodno%, network$, direction$, programgroup$) AS STRING
  261. DECLARE PUBLIC FUNCTION UINOT (prodno%, network$, direction$) AS STRING
  262. DECLARE PUBLIC FUNCTION PostSuccessRegNOT (prodno%, network$, direction$) AS STRING
  263. DECLARE PUBLIC SUB AddRegistryKeysNOT (prodno%, network$) 
  264. DECLARE PUBLIC FUNCTION InitLanguageNOT (prodno%, network$, direction$) AS STRING
  265. DECLARE SUB NOT_RegisterSharedComponent(Key$, FileName$, Version$)
  266.  
  267.  
  268. '** Product specific functions
  269. '*****************************
  270. DECLARE PUBLIC FUNCTION SERVERSWITCH(Chapter$,fInCopy%) AS INTEGER
  271. DECLARE PUBLIC FUNCTION PROGSWITCH(Chapter$,fInCopy%) AS INTEGER
  272. DECLARE PUBLIC FUNCTION PDATASWITCH(Chapter$,fInCopy%) AS INTEGER
  273. DECLARE PUBLIC FUNCTION ADVANCEDSWITCH(Chapter$,fInCopy%) AS INTEGER
  274. DECLARE PUBLIC FUNCTION AUTOLOGONSWITCH(Chapter$,fInCopy%) AS INTEGER
  275. DECLARE PUBLIC FUNCTION NETNOTESSWITCH(Chapter$,fInCopy%) AS INTEGER
  276. DECLARE PUBLIC FUNCTION NTUSERSYNC(Chapter$,fInCopy%) AS INTEGER
  277. DECLARE FUNCTION IsNotesInRegistry(NotesPath$) AS INTEGER
  278. DECLARE FUNCTION IsNotesOnPath(NotesFromPath$) AS INTEGER
  279. DECLARE FUNCTION IsNotesInLotusIni(NotesFromLotus$) AS INTEGER
  280. DECLARE FUNCTION IsNotesInSessMgr(NotesIniFromSessionMgr$) AS INTEGER
  281. DECLARE FUNCTION IsNotesIniOnPath(NotesIniFromPath$) AS INTEGER
  282. DECLARE FUNCTION IsNotesIniInWinDir(NotesIniFromWinDir$) AS INTEGER
  283. DECLARE FUNCTION IsNotesDataInRegistry(NotesDataFromRegistry$) As INTEGER
  284. DECLARE FUNCTION IsPartitonedInstall(PartitonProg$, PartitionData$)AS INTEGER
  285. DECLARE FUNCTION DetectPreviousVersion () AS STRING
  286. DECLARE FUNCTION GetNotesFromPath (network$)
  287. DECLARE FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  288. 'DECLARE SUB WriteProgMan(network$, prodno%, title$)
  289. DECLARE SUB WriteWinIni(prodno%)
  290. DECLARE SUB WriteNOTIni(network$, prodno%)
  291. DECLARE SUB WriteOLERegForNOT(network$, prodno%)
  292. DECLARE SUB WriteNOTInLotusIni(prodno%)
  293. DECLARE SUB WriteMAPIRegForNOT(network$, prodno%)
  294. DECLARE FUNCTION WriteNotesReg(prodno%) AS INTEGER
  295. DECLARE FUNCTION WritePartionedinfo(prodno%, network$) AS INTEGER
  296. DECLARE FUNCTION ReadInf(direction$) AS INTEGER
  297. DECLARE FUNCTION DoesFileExistOnPath (Path$, FileName$) AS STRING
  298. DECLARE FUNCTION ValidateIni(IniFile$) AS INTEGER
  299.  
  300. DECLARE PUBLIC FUNCTION PartionedCmdProc(instance%) AS INTEGER
  301. DECLARE FUNCTION DoesFileExistInDir (dirlist$) AS INTEGER
  302. DECLARE FUNCTION GetObsoleteFiles(direction$) AS STRING
  303. DECLARE FUNCTION GetLine(File%, mstr$) AS INTEGER
  304. DECLARE FUNCTION GetNotesPathFromLotusIni() AS String
  305. DECLARE SUB MCUSTOM2CB (hDlg&, CtrlId%, Classes$, Inst&)
  306.  
  307.  
  308.  
  309.  
  310.  
  311. CONST MAX_PAGES        = 4
  312. CONST NUMOFBILLBDS    = 12
  313. CONST SYM_CUSTOMCOST$    = "CustomCostList"  '** Use only in this module.
  314. CONST MAXKEYPATH    = 256
  315. CONST INLIST        = 1                '** Chapter is in copylist.
  316. CONST OUTOFLIST        = 0                '** Chapter is out of copylist.
  317. CONST VISIBLE        = 1                '** Display the chapter in the custom window.
  318. CONST INVISIBLE        = 0                '** Don't display the chapter in the custom window.
  319.  
  320. %include "lserr.lss"
  321.  
  322.  
  323. PUBLIC CONST LB_ADDSTRING            = (&H0400+1)
  324. PUBLIC CONST LB_INSERTSTRING        = (&H0400+2)
  325. PUBLIC CONST LB_DELETESTRING        = (&H0400+3)
  326. PUBLIC CONST LB_RESETCONTENT        = (&H0400+5)
  327. PUBLIC CONST LB_SETSEL                = (&H0400+6)
  328. PUBLIC CONST LB_SETCURSEL            = (&H0400+7)
  329. PUBLIC CONST LB_GETSEL                = (&H0400+8)
  330. PUBLIC CONST LB_GETCURSEL            = (&H0400+9)
  331. PUBLIC CONST LB_GETTEXT                = (&H0400+10)
  332. PUBLIC CONST LB_GETTEXTLEN            = (&H0400+11)
  333. PUBLIC CONST LB_GETCOUNT            = (&H0400+12)
  334. PUBLIC CONST LB_SELECTSTRING        = (&H0400+13)
  335. PUBLIC CONST LB_DIR                    = (&H0400+14)
  336. PUBLIC CONST LB_GETTOPINDEX        = (&H0400+15)
  337. PUBLIC CONST LB_FINDSTRING            = (&H0400+16)
  338. PUBLIC CONST LB_GETSELCOUNT        = (&H0400+17)
  339. PUBLIC CONST LB_GETSELITEMS        = (&H0400+18)
  340. PUBLIC CONST LB_SETTABSTOPS        = (&H0400+19)
  341. PUBLIC CONST LB_GETHORIZONTALEXTENT = (&H0400+20)
  342. PUBLIC CONST LB_SETHORIZONTALEXTENT = (&H0400+21)
  343. PUBLIC CONST LB_SETCOLUMNWIDTH    = (&H0400+22)
  344. PUBLIC CONST LB_SETTOPINDEX        = (&H0400+24)
  345. PUBLIC CONST LB_GETITEMRECT        = (&H0400+25)
  346. PUBLIC CONST LB_GETITEMDATA        = (&H0400+26)
  347. PUBLIC CONST LB_SETITEMDATA        = (&H0400+27)
  348. PUBLIC CONST LB_SELITEMRANGE        = (&H0400+28)
  349. PUBLIC CONST LB_SETCARETINDEX        = (&H0400+31)
  350. PUBLIC CONST LB_GETCARETINDEX        = (&H0400+32)
  351. PUBLIC CONST LB_ERR                    = -1
  352. PUBLIC CONST MAXFILES                = 500
  353.  
  354. PUBLIC CONST SECTIONSTART            = "["    '** Start of new section
  355. PUBLIC CONST SECTIONEND                = "]"    '** End of section
  356. PUBLIC CONST COMMENT                = ";"    '** Comment character
  357. PUBLIC CONST SEPERATOR                = "="    '** File seperator
  358.                 
  359. PUBLIC CONST OBSFILE                = "obsolete.nam"    '** List of files to be deleted
  360.  
  361. '** Files used to locat prior versions of Notes.
  362. PUBLIC CONST W16_NOTES                = "_strings.dll"
  363. PUBLIC CONST P16_NOTES                = "$strings.dll"
  364. PUBLIC CONST P32_NOTES                = "istrings.dll"
  365. PUBLIC CONST ANYVERSION                = "?strings.dll"
  366. PUBLIC CONST DEFAULTKIT                = "1"
  367.  
  368. TYPE PAGEINFO
  369.    szChapter AS STRING     '** Chapter that started the page
  370.    idPage    AS INTEGER    '** Page ID
  371.    hDlgPage  AS INTEGER    '** Page dialog handle
  372.    nSel      AS INTEGER    '** Current Selection in page
  373. END TYPE
  374.  
  375. '** Globals
  376. DIM ghDlg&                             '** Save the parent dialog
  377. DIM gCurrentPageIndex%                 '** The current page index (into array)
  378. DIM gNumPages%                         '** Number of pages in gPageArray
  379. DIM gPageArray(MAX_PAGES) AS PAGEINFO  '** Page info for up to 8 pages
  380. DIM gDelete%                           '** Should we search for old files
  381. DIM gDeleteDialogText$
  382. '**
  383. '** The following setting should be 
  384. '** filled in via GetNotesFromPath routine
  385. '** this routiene should only be called ONCE !!!!!
  386. '** 
  387. DIM gKitType$                           '** Type of install
  388. DIM gNotesProg$                           '** Location of Notes Program Directory
  389. DIM gNotesData$                           '** Location of Notes Data Directory
  390. DIM gNotesini$                           '** Location of Notes.ini
  391. DIM gNotesNlm$                           '** Location of Notes Program Directory
  392. DIM gNlmDir$                           '** NOVELL Volume Name
  393. DIM gPreviousNotesInstalled%            '** 0 = Notes not installed
  394. DIM gNotesReg$
  395. DIM gInstance%                            '** Instance if Virtual server
  396. DIM gNotesRegTmp$
  397. DIM gNodeDir$                            '** This is the location of the Node Installer
  398. DIM gNotesPartitionedProg$            '** Partitioned Program directory
  399. DIM gPartitioned%                            '** 0 = Virtual Server Not installed
  400. DIM gPartitionsInstalled%                    '** Once set this should never be changed
  401.                                         '** it's use is to allow the user to step
  402.                                         '** back in the installer
  403. CONST INIFILE$ = "Notes.ini"
  404. DIM gInstallType%                        '** 0 - Standard Install
  405.                                         '** 1 - Partioned Server
  406.                                         '** 2 - NLM Server
  407. DIM OSTYPE LIST AS STRING
  408.  
  409.  
  410. '*************************************************************************
  411. '**************************** Required Functions *************************
  412. '*************************************************************************
  413.  
  414. '*************************************************************************
  415. '** SUB Initialize
  416. '**
  417. '** Purpose: The only purpose of this routine is to register your product.
  418. '**          This routine assigns your acronym to your product.
  419. '**          Without this function, your product will not install.
  420. '**          All you need to do in this subroutine is:
  421. '**                   modify NOT -> your acronym.
  422. '**
  423. '**          ASSUMPTIONS: Many things in the toolkit key off of your
  424. '**                       acronym. These are the constraints:
  425. '**                       1. Your top level chapter in the INF must
  426. '**                          have a KEYWORD of your acronym +"TOP"
  427. '**                          e.g. acronymTOP
  428. '** Author:  Marcel Meth  
  429. '** Arguments: None
  430. '** Returns:   NONE
  431. '*************************************************************************
  432. SUB Initialize
  433.    Reg_RegisterProductNames "NOT", LdString(SID_NOT_COMMERCIALNAME) 
  434. END SUB
  435.  
  436. '*************************************************************************
  437. '** FUNCTION ProductRegNOT (prodno%, network$, direction$) AS INTEGER
  438. '**
  439. '** Purpose: This function allows your product to register itself
  440. '**          in the Install Product Registry.  The toolkit stores
  441. '**          the information provided and will provide you with
  442. '**          various features accordingly.  For example, if you support
  443. '**          shared files, the toolkit will do most of the work
  444. '**          for the LOTUSAPP directory.
  445. '**
  446. '**          For the most part you should use only Reg_Set... Functions.
  447. '**          
  448. '**
  449. '**          If you turn on ATM, LICENSING, or SHARED tools, then
  450. '**          you must be sure to add the appropriate lines and files
  451. '**          in your acronym.SCR and acronym.LYT, respectively. 
  452. '**          See Cookbook.
  453. '**
  454. '**          If you support server install, (because you need the files
  455. '**          for Licenser), you will have to make sure that you have 
  456. '**          the correct **entire** contents of install.lyt and install.scr 
  457. '**          for the install files in your acronym.SCR and acronym.LYT
  458. '**          
  459. '**
  460. '** Arguments:  All paremeters are **read only**. 
  461. '**          prodno%: This is your prodno%.  It is assigned to you by the
  462. '**                   toolkit in the order in which you were registered.
  463. '**                   When your product is part of SmartSuite, SmartSuite
  464. '**                   will always be product #1. (prodno% >=1)
  465. '**          network$: UNINITIALIZED
  466. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  467. '**                      then step backwards, i.e start at your last dialog
  468. '**                      first.
  469. '**     
  470. '** Errors:    No return code for errors, you must Raise them
  471. '** Author:    MMeth
  472. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  473. '**                             allow the user to step backwards.)
  474. '*************************************************************************
  475.  
  476. PUBLIC FUNCTION ProductRegNOT (prodno%, network$, direction$) AS STRING
  477. DIM dum%, Str1$, Str2$
  478.  
  479.     ProductRegNOT = gNEXT
  480.  
  481.     '** FOR a complete set of things to register
  482.     '** see API doc under Reg_Set...
  483.  
  484.     'Reg_SetSupportedInstallTypes ProdNo%, Server%, Custom%, Client%
  485.  
  486.  
  487.  
  488.  
  489.  
  490.     Reg_SetSupportedInstallTypes prodno%, 1, 1, 1
  491.     '** Set the sise of the Workstation and Server Installs.
  492.     Reg_SetProdSizes prodno%, DESIGNERSIZE, WORKSIZE
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.     '** If you need Lotusapp or datalens support turn this on.
  504.     Reg_SetShareFlags prodno%, 0, 0, 0, 0 
  505.  
  506.     '** If you need Components directory turn this on.
  507.     Reg_SetShare32Flag prodno%, 0
  508.  
  509.     '** Coming to an install program near you soon
  510.     'Reg_SetCDOption prodno%,Inst%,CDOptStr$ 
  511.     'Reg_SetCDOptionSelected ProdNo%,Inst%,Selection% 
  512.  
  513.     '** Any options that you want your sys-admin and node user to see
  514.     '** must be entered here.  They must correspond with keywrods in the
  515.     '** inf file. This functionality will be avilable March 4, but you
  516.     '** can set these fields now!
  517.     '   Reg_SetNodeOption ProdNo%,Inst%,NodeOptStr$  
  518.     '   Reg_SetNodeOptionSelected ProdNo%,Inst%,Selection% 
  519.  
  520.     '** If the partitioned server isn't installed then display 
  521.     '** the install on file server option.
  522.     dum% = IsPartitonedInstall(Str1$, Str2$)
  523.     IF gPartitioned% = 0 THEN
  524.     '** Toolkit default is for no file server supprt, turn on if desired.
  525.  
  526.         Reg_SetSrvSupport prodno%, 1
  527.  
  528.  
  529.  
  530.         Reg_SetExtraProdDirsNum prodno%, 1
  531.  
  532.     ELSE
  533.         '** Toolkit default is for no server supprt, turn on if desired.
  534.         Reg_SetSrvSupport prodno%, 0
  535.         Reg_SetExtraProdDirsNum prodno%, 0
  536.     END IF
  537.  
  538.     '** Toolkit default is for no server supprt, turn on if desired.
  539.     '** license support only available for server install.
  540.     Reg_SetLicenseSupport prodno%, 0
  541.  
  542.     '** Toolkit default is no ATM support
  543.     'Reg_SetATMSupport prodno%, 0
  544.  
  545.     '** This is the default value the user will see.
  546.     Reg_SetProgManagerGroup prodno%, LdString(SID_NOT_DEFAULT_GROUP)
  547.  
  548.     '** Required if you have a work, smartmasters and backup directories
  549.     '** register support with the toolkit to surface the dialog
  550.     Reg_SetMoreDirsData prodno%, "NOTMOREDIRSCB", DBNOT_MOREDIRS, DBNOT_MOREDIRS    
  551.  
  552.  
  553. END FUNCTION
  554.  
  555. '*************************************************************************
  556. '** FUNCTION DefaultUserRegNOT (prodno%, network$, direction$) AS STRING
  557. '**
  558. '** Purpose: **Only** the first registered product gets called.
  559. '**          For SmartSuite, this will be SmartSuite.
  560. '**          This function allows you to set the default user registration
  561. '**          information that the user will be shown. The toolkit
  562. '**          will provide default values from MS-Windows. If you disagree
  563. '**          with them you should modify them in this function using:
  564. '**          SetSymbolValue on SYM_NAME, SYM_COMPANY & SYM_SERIALNUM$
  565. '**          
  566. '**          It is up to you how you store registration information.
  567. '**          It will not be stored until later in PostCopyConfigNOT.
  568. '**          The CIT provides functions that allow you to access .ri 
  569. '**          files: Lot_ReadDefaultsfromRi(ripath$).
  570. '**
  571. '**          If you need to write back to the floppy, do it here.
  572. '**          Most Lotus products will no longer write back to the floppy.
  573. '**          Remeber, you can't write back to a CD or network!
  574. '**
  575. '** In Symbols : SYM_NAME$, SYM_COMPANY$
  576. '** Out Symbols: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
  577. '**            
  578. '** Arguments:  All paremeters are **read only**. 
  579. '**          prodno%: This is your prodno%.  It is assigned to you by the
  580. '**                   toolkit in the order in which you were registered.
  581. '**                   When your product is part of SmartSuite, SmartSuite
  582. '**                   will always be product #1. (prodno% >=1)
  583. '**          network$: UNINITIALIZED
  584. '**          network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  585. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  586. '**                      then step backwards
  587. '**     
  588. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  589. '**                      then step backwards, i.e start at your last dialog
  590. '**                      first.
  591. '**     
  592. '** Errors:    No return code for errors, you must Raise them
  593. '** Author:    MMeth
  594. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  595. '**                             allow the user to step backwards.)
  596. '*************************************************************************
  597.  
  598. PUBLIC FUNCTION DefaultUserRegNOT (prodno%, network$, direction$) AS STRING
  599.     DIM ripath$, defdir$, dum%, rc%
  600.     DIM NotesDataFromRegistry$
  601.  
  602.     DefaultUserRegNOT = gNEXT
  603.     '** Always find out if notes is installed.
  604.     SetSymbolValue "SYM_COMPANY$", " "
  605.  
  606.     '** If this is a node install get the path of the node installer
  607.     '** and save it. We will need this when update
  608.     IF network$ = gNODE$ THEN    gNodeDir$ = GetSymbolValue(SYM_STF_SRCDIR$)
  609.     
  610. '** Only use the Registry to get this information. This means we are
  611. '** running Notes V4.0 or Better.
  612.  
  613.     rc% = IsNotesDataInRegistry(NotesDataFromRegistry$)
  614.  
  615.     IF network$ = gNODE$ THEN
  616.         defdir$ = NotesDataFromRegistry$
  617.         if defdir$ = "" goto rinotfound
  618.         ripath$ = defdir$ + "notes.ri"
  619.  
  620.     ElSEIF network$ = gSTANDARD$ THEN
  621.         defdir$ = gNotesProg$
  622.     IF defdir$ = "" goto rinotfound
  623.         ripath$ = defdir$ + "notes.ri"
  624.  
  625.     END IF
  626.  
  627.    '' RETURNS TRUE IF SUCCESSFULLY FOUND RI FILE AND READ INFORMATION
  628.    rc% = Lot_ReadDefaultsfromRi(ripath$) 
  629.  
  630. rinotfound:
  631.  
  632. END FUNCTION
  633.  
  634.  
  635. '*************************************************************************
  636. '** FUNCTION InitNOT (prodno%, network$, direction$, basedir$) AS STRING
  637. '**
  638. '** Purpose: This function will be called after the Welcome dialog has been
  639. '**          filled in by the user. This is the first time you will be 
  640. '**          called when the server parameter is valid.  
  641. '**          You need to use this function to intialize certain things. 
  642. '**          (See the MUST DO below).
  643. '**          
  644. '**          This is a good place to put up a LotusScript messagebox warning the user
  645. '**          of a previous version of your product. If there is a previous
  646. '**          version you might want to steer them towards overwriting it,
  647. '**          deleting the old version, or allowing both versions to exist.
  648. '**          
  649. '**
  650. '** Must Do: You **MUST** set inital values for all of the destination
  651. '** =======  directories that you refer to in your INF file.  If you do not,
  652. '**          then InitCopylist will fail!  e.g. SetSymbolValue "NOTDIR", basedir$
  653. '**          Of course you may be more intelligent.  You should preface your
  654. '**          directory with basedir$.  The toolkit is finding a good drive
  655. '**          letter and basedirectory.  Also, remeber all paths end in a
  656. '**          \ and are lower case.
  657. '**
  658. '**          You should **NOT** define LOTUSAPPDIR, NETLOTUSAPPDIR, WINDIR, &
  659. '**          WINSYSDIR. The toolkit does this for you.
  660. '**
  661. '**          Once you have defined destdir symbols, you need to register
  662. '**          them with the toolkit. (See the code below)
  663. '**
  664. '** In Symbols : 
  665. '** Out Symbols: 
  666. '**            
  667. '** Arguments:  All paremeters are **read only**. 
  668. '**          prodno%: This is your prodno%.  It is assigned to you by the
  669. '**                   toolkit in the order in which you were registered.
  670. '**                   When your product is part of SmartSuite, SmartSuite
  671. '**                   will always be product #1. (prodno% >=1)
  672. '**          network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  673. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  674. '**                      then step backwards
  675. '**     
  676. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  677. '**                      then step backwards, i.e start at your last dialog
  678. '**                      first.
  679. '**
  680. '**          basedir$:   The toolkit has found a good base. for your directory.
  681. '**                      This is it.  You should use it.  This will make Smart
  682. '**                      Suite work, and will pick a good drive letter for you.
  683. '**     
  684. '** Errors:    No return code for errors, you must Raise them
  685. '** Author:    MMeth
  686. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  687. '**                             allow the user to step backwards.)
  688. '**
  689. '*************************************************************************
  690.  
  691. PUBLIC FUNCTION InitNOT (prodno%, network$, direction$, basedir$) AS STRING
  692. DIM sym$, symname$, defdir$, position%, proddir$, iniPath$, rv%
  693. DIM dum%, previousprod$, Program$, RCDialog$, notused%
  694. DIM tmpSym$, tmpToChange$, temp%, inidir$, tmpname$
  695. DIM parentdir$, nProducts%, i%
  696.  
  697.     gDelete = 0            'Default to no search 
  698.     '** On our way through here ALWAYS re-initialize the Global Notes dirs.
  699.     '** GetgNotesProg and gNotesIni directories. Remember gNotesIni points
  700.     '** to the location of the Notes.ini file not the NOTES DATA DIRECTORY.
  701.     dum% = GetNotesFromPath(network$)
  702.  
  703.     IF gDebugInitNot = 1 THEN PRINT "basedir set it to :"basedir$
  704.     '** Work around for CIT BUG on second call to InitNOT basedir $ is empty
  705.     '** So we set it to the drive selected by the user.
  706.     IF basedir$ = "" THEN
  707.         basedir$ = LEFT$(GetSymbolValue("NOTDIR"),3)
  708.         IF gDebugInitNot = 1 THEN PRINT "basedir is now set to :"basedir$
  709.     END IF
  710.  
  711.     '** remove the Lotus path from the directory if it exists
  712.     temp% = instr(basedir$, "\lotus\")
  713.     IF temp%  <> 0 THEN
  714.         tmpname$ = LEFT$(basedir$, temp%)
  715.         tmpSym$ = MID$(basedir$, temp%+7, LEN(basedir$))
  716.         basedir$ = tmpname$+tmpSym$
  717.     end if
  718.  
  719.     InitNOT = direction$
  720.     '' In the backwards case, keep backing up
  721.     IF direction$ = gBACK Then
  722.        EXIT FUNCTION
  723.     End IF
  724.     '' Setup Default directory settings and the associated
  725.     '' text that the user will see
  726.  
  727.     sym$ = Reg_GetDirSymbolList(prodno%)
  728.     symname$ = sym$ + gNAME
  729.  
  730.     ''** Set Up default directories
  731.     SetListItem sym$, 1, "NOTDIR"                    'Drive+Initial Notes Directory
  732.     SetListItem symname$, 1, "NOTDIRNAME"            'Notes Directory Name
  733.  
  734.     SetListItem sym$, 2, "NOTWORKDIR"                'Drive+Initial Notes Data Directory
  735.     SetListItem symname$, 2, "NOTWORKDIR"            'Notes Data Directory Name
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.     '** If the global symbols for Notes are set then Notes has been installed on this 
  745.     '** system, so let the user know this via a dialog box.
  746.  
  747.     IF gNotesProg$ <> ""  OR gNotesData$ <> "" Then
  748.         direction$ = PopupModalDlg (DB_EXISTINGNOTES, DB_EXISTINGNOTES)
  749.         IF direction$ = gBACK Then
  750.             InitNOT = direction$
  751.          EXIT FUNCTION
  752.       End IF
  753.     End If
  754.  
  755.     '** If the Global gNotesProg ("Notes Program Directory") hasen't
  756.     '** been set because it's not installed then use the 
  757.     '** default Notes directory. 
  758.  
  759.     IF gNotesProg$ = "" THEN
  760.         SetSymbolValue "NOTDIR", basedir$ + Lot_TrimEndSlash(LdString(SID_NOT_DIR))
  761.         gNotesProg$ = GetSymbolValue("NOTDIR")
  762.         gNotesPartitionedProg$ =  GetSymbolValue("NOTDIR")
  763.     End If
  764.  
  765.     '** If the Global gNotesData ("Notes Data Directory") hasen't
  766.     '** been set because it's not installed then use the 
  767.     '** default Notes data directory.
  768.     IF gNotesData$ = "" THEN
  769.        SetSymbolValue "NOTWORKDIR", basedir$ + Lot_TrimEndSlash(LdString(SID_NOT_WORKDIR))
  770.         gNotesData$ = GetSymbolValue("NOTWORKDIR")
  771.     End If
  772.  
  773.     '** Set up the common install symbols for the directories.
  774.     SetListItem sym$, 1, "NOTDIR"                    'Drive+Initial Notes Directory
  775.     SetListItem symname$, 1, "NOTDIRNAME"            'Notes Directory Name
  776.     SetSymbolValue "NOTDIR", gNotesProg$
  777.  
  778.     SetListItem sym$, 2, "NOTWORKDIR"                'Drive+Initial Notes Data Directory
  779.     SetListItem symname$, 2, "NOTWORKDIRNAME"        'Notes Data Directory Name
  780.     SetSymbolValue "NOTWORKDIR", gNotesData$
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.     '** Figure out why I added this !!!
  791.     IF gNotesData$ = ""  AND gNotesProg$ = "" THEN gPreviousNotesInstalled% = 0
  792.  
  793.  
  794.     SELECT CASE network$
  795.  
  796.    CASE gSERVER$
  797.         '** On a server Install i.e. FileServer install we want the Program and Data
  798.         '** directories to be the same . This is because the NODE install script
  799.         '** has all the proper directory information in it.
  800.         gNotesData$ = gNotesProg$
  801.           SetSymbolValue "NOTDIR", gNotesProg$
  802.        SetSymbolValue "NOTWORKDIR", gNotesData$
  803.         Lot_RefreshDestination("NOTDIR")
  804.         Lot_RefreshDestination("NOTWORKDIR")
  805.  
  806.    CASE gDISTRIBUTION$
  807.  
  808.    CASE gSTANDARD$
  809.     '** If by some chance we ended up here without the global symbol
  810.     '** for the Notes program directory being set, make sure it's set
  811.     '** to the default.
  812.  
  813.     IF gNotesProg$ = "" THEN
  814.         SetSymbolValue "NOTDIR", basedir$ + Lot_TrimEndSlash(LdString(SID_NOT_DIR))
  815.         gNotesProg$ = GetSymbolValue("NOTDIR")
  816.         gNotesPartitionedProg$ =  GetSymbolValue("NOTDIR")
  817.     End If
  818.  
  819.     IF gNotesData$ = "" THEN
  820.        SetSymbolValue "NOTWORKDIR", basedir$ + Lot_TrimEndSlash(LdString(SID_NOT_WORKDIR))
  821.         gNotesData$ = GetSymbolValue("NOTWORKDIR")
  822.     End If
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.     SetListItem sym$, 1, "NOTDIR"                        'Drive+Initial Notes Directory
  832.     SetListItem symname$, 1, "NOTDIRNAME"            'Notes Directory Name
  833.       SetSymbolValue "NOTDIR", gNotesProg$
  834.  
  835.     SetListItem sym$, 2, "NOTWORKDIR"                'Drive+Initial Notes Data Directory
  836.     SetListItem symname$, 2, "NOTWORKDIRNAME"        'Notes Data Directory Name
  837.     SetSymbolValue "NOTWORKDIR", gNotesData$
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.     IF gNotesData$ = ""  AND gNotesProg$ = "" THEN gPreviousNotesInstalled% = 0
  848.  
  849.  
  850.    CASE gNODE$
  851.  
  852.         '** Since this is a node install then the program directory is the same as
  853.         '** the data directory.
  854.         gNotesProg$ = gNotesData$
  855.         SetSymbolValue "NOTDIR", gNotesProg$
  856.         SetSymbolValue "NOTWORKDIR", gNotesProg$
  857.  
  858.     ''       ****** Language Install Code ******
  859.     '' Mark language content directory symbols that need source file
  860.     '' adjustment (adding language subdirectory)
  861. '        IF IsServerSecondaryLanguage THEN'
  862. '            MarkSourceLanguageSubdir("NOTLANGDIR")
  863. '        END IF
  864.  
  865.     END SELECT
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.     IF gDebugInitNot = 1 THEN PRINT "Notes dir is :"GetSymbolValue("NOTDIR")
  873.     IF gDebugInitNot = 1 THEN PRINT "Notes dir name is :"GetSymbolValue("NOTDIRNAME")
  874.     IF gDebugInitNot = 1 THEN PRINT "Notes Work dir is :"GetSymbolValue("NOTWORKDIR")
  875.     IF gDebugInitNot = 1 THEN PRINT "Notes Work dir name is :"GetSymbolValue("NOTWORKDIRNAME")
  876.     IF gDebugInitNot = 1 THEN PRINT "Notes NLM dir is :"GetSymbolValue("NOTNLMDIR")
  877.     IF gDebugInitNot = 1 THEN PRINT "Notes NLM dir name is :"GetSymbolValue("NOTNLMDIRNAME")
  878.     IF gDebugInitNot = 1 THEN PRINT "Notes NLM Work dir is :"GetSymbolValue("NOTNLMWORKDIR")
  879.     IF gDebugInitNot = 1 THEN PRINT "Notes NLM Work dir name is :"GetSymbolValue("NOTNLMWORKDIRNAME")
  880.  
  881.  
  882. END FUNCTION
  883.  
  884. '*************************************************************************
  885. '** FUNCTION PrevVersionsNOT (prodno%, network$, direction$) AS STRING
  886. '**
  887. '** Purpose: This function is called only for SmartSUite.  It is called
  888. '**          immediately after all the other product functions for
  889. '**          InitNOT are called.  It allows SmartSuite to assess whether
  890. '**          there are older versions of products around.
  891. '**          
  892. '** In Symbols : 
  893. '** Out Symbols: 
  894. '**            
  895. '** Arguments:  All paremeters are **read only**. 
  896. '**          prodno%: This is your prodno%.  It is assigned to you by the
  897. '**                   toolkit in the order in which you were registered.
  898. '**                   When your product is part of SmartSuite, SmartSuite
  899. '**                   will always be product #1. (prodno% >=1)
  900. '**          network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  901. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  902. '**                      then step backwards
  903. '**     
  904. '**          direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  905. '**                      then step backwards, i.e start at your last dialog
  906. '**                      first.
  907. '**
  908. '** Errors:    No return code for errors, you must Raise them
  909. '** Author:    MMeth
  910. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  911. '**                             allow the user to step backwards.)
  912. '**
  913. '*************************************************************************
  914.  
  915. PUBLIC FUNCTION PrevVersionsNOT (prodno%, network$, direction$) AS STRING
  916. DIM nProducts%, prodIndex%, i%
  917.  
  918.       nProducts% = Reg_GetNumberOfProducts()
  919.       FOR prodIndex% = 1 to nProducts%
  920.           If Reg_GetPreviousVersion(prodIndex%) <> "" Then
  921.              i% = DoMsgBox("Older Versions Found","", MB_OK)
  922.              GOTO PREVPRODFOUND
  923.           END IF
  924.       NEXT
  925.  
  926. PREVPRODFOUND:
  927.  
  928. END FUNCTION
  929.  
  930.  
  931. '*************************************************************************
  932. '** FUNCTION PathChangeNOT (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  933. '**
  934. '** Purpose: This function is called whenever the user proposes changes
  935. '**          to a path for your product.  By the time this function calls
  936. '**          you, the paths have already been checked syntactically, and
  937. '**          the directory has been checked to see that it is writeable.
  938. '**          Your obligation is to verify that the proposed new path is ok
  939. '**          with you.  If not, put up a Lotus Script :"MESSAGEBOX" 
  940. '**          telling the user and return gBACK.
  941. '**          
  942. '** In Symbols : 
  943. '** Out Symbols: 
  944. '**            
  945. '** Arguments:  All paremeters are **read only**. 
  946. '**          prodno%: This is your prodno%.  It is assigned to you by the
  947. '**                   toolkit in the order in which you were  registered.
  948. '**                   When your product is part of SmartSuite, SmartSuite
  949. '**                   will always be product #1. (prodno% >=1)
  950. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  951. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  952. '**                      then step backwards
  953. '**      destdirsym$: The destdir symbol that has changed. e.g. "NOTDIR"
  954. '**   mainprodsonly%: (TRUE | FALSE) , when TRUE this means that only
  955. '**                   your top level product directory should change,
  956. '**                   probably "NOTDIR". When it is false, it means that
  957. '**                   all related directories should change. It is **YOUR
  958. '**                   RESPONSIBILITY**  to implement this functionality.
  959. '**     
  960. '** Errors:    No return code for errors, you must Raise them
  961. '** Author:    MMeth
  962. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  963. '**                             allow the user to step backwards.)
  964. '**
  965. '*************************************************************************
  966.  
  967.             '** in a node install the workdir never gets set so do it here.
  968. PUBLIC FUNCTION PathChangeNOT (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
  969. DIM path$, dum$, notused%
  970.  
  971.     ON ERROR GOTO NEWNOTES
  972. '    IF gDebugPathChangeNot = 1 THEN PRINT "Product number is :"+STR$(prodno%)
  973. '    IF gDebugPathChangeNot = 1 THEN PRINT "Install type is :"+network$
  974. '    IF gDebugPathChangeNot = 1 THEN PRINT "Direction is :"+Direction$
  975.     IF gDebugPathChangeNot = 1 THEN PRINT "Desdirsym is :"+destdirsym
  976.     IF gDebugPathChangeNot = 1 THEN PRINT "mainprodsonly is :"+STR$(mainprodsonly%)
  977.    PathChangeNOT = gNEXT
  978.  
  979.  
  980.     IF destdirsym$ = "NOTDIR" OR destdirsym$ = GetSymbolValue("NOTDIR") THEN 
  981.         IF gDebugPathChangeNot = 1 THEN PRINT "processing NOTDIR"
  982.         path$ = GetSymbolValue(destdirsym$)
  983.     
  984.         gNotesProg$ = path$
  985.  
  986.         IF network$ = gSERVER$ OR network$ = gNODE$ THEN
  987.             gNotesProg$ = GetSymbolValue("NOTDIR")
  988.             gNotesData$ = gNotesProg$
  989.  
  990.             '** in a node install the workdir never gets set so do it here.
  991.             IF network$ = gNODE$ THEN
  992.                 gNotesProg$ = GetSymbolValue("NOTDIR")
  993.                 gNotesData$ = gNotesProg$
  994.                 SetSymbolValue "NOTWORKDIR", gNotesData$
  995.                 Lot_RefreshDestination("NOTWORKDIR")
  996.             END IF
  997.         END IF
  998.  
  999.         IF gPartitioned = 1 then 
  1000.             gNotesData$ = gNotesProg$
  1001.         ELSE
  1002.             gNotesPartitionedProg$ =  gNotesProg$
  1003.         END IF
  1004.  
  1005.         SetSymbolValue "NOTDIR", gNotesProg$
  1006.         Lot_RefreshDestination("NOTDIR")
  1007.     END IF
  1008.  
  1009.     IF destdirsym$ = "NOTWORKDIR" OR destdirsym$ = GetSymbolValue("NOTWORKDIR") THEN 
  1010.         IF gDebugPathChangeNot = 1 THEN PRINT "processing NOTWORKDIR"
  1011.         path$ = GetSymbolValue(destdirsym$)
  1012.  
  1013.  
  1014.  
  1015.  
  1016.         gNotesData$ = path$
  1017.  
  1018.         IF network$ = gSERVER$ OR network$ = gNODE$ THEN
  1019.             gNotesData$ = GetSymbolValue("NOTDIR")
  1020.         END IF
  1021.  
  1022.         IF network$ = gNODE$ THEN
  1023.             gNotesData$ = GetSymbolValue("NOTDIR")
  1024.         END IF
  1025.  
  1026.         IF gPartitioned = 1 then 
  1027.             gNotesData$ = GetSymbolValue("NOTDIR")
  1028.         ELSE
  1029.             gNotesPartitionedProg$ =  GetSymbolValue("NOTDIR")
  1030.         END IF
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.         SetSymbolValue "NOTWORKDIR", gNotesData$
  1040.         Lot_RefreshDestination("NOTWORKDIR")
  1041.  
  1042.     END IF
  1043.  
  1044.     IF gDebugPathChangeNot = 1 THEN PRINT "gNotesProg is :"+gNotesProg$
  1045.     IF gDebugPathChangeNot = 1 THEN PRINT "gNotesData is :"+gNotesData$
  1046.     IF gDebugPathChangeNot = 1 THEN PRINT "gNotesNnlm is :"+gNotesNlm$
  1047.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes dir is :"GetSymbolValue("NOTDIR")
  1048.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes dir name is :"GetSymbolValue("NOTDIRNAME")
  1049.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes Work dir is :"GetSymbolValue("NOTWORKDIR")
  1050.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes Work dir name is :"GetSymbolValue("NOTWORKDIRNAME")
  1051.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes NLM dir is :"GetSymbolValue("NOTNLMDIR")
  1052.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes NLM dir name is :"GetSymbolValue("NOTNLMDIRNAME")
  1053.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes NLM Work dir is :"GetSymbolValue("NOTNLMWORKDIR")
  1054.     IF gDebugPathChangeNot = 1 THEN PRINT "Notes NLM Work dir name is :"GetSymbolValue("NOTNLMWORKDIRNAME")
  1055.     '** User changed dir so default to new install
  1056.     dum$ = DIR(gNotesProg$,16)
  1057.     dum$ = DIR(gNotesData$,16)
  1058.  
  1059.  
  1060.  
  1061. DONE:
  1062.     EXIT FUNCTION
  1063.  
  1064. NEWNOTES:
  1065.     gPreviousNotesInstalled% = 0
  1066.     RESUME DONE
  1067. END FUNCTION
  1068.  
  1069.  
  1070.  
  1071.  
  1072. '*************************************************************************
  1073. '** FUNCTION InitCopyListNOT (prodno%, network$, direction$) AS STRING
  1074. '**
  1075. '** Purpose:  Product must Initialize the copylist
  1076. '**          
  1077. '** Must Do: You must initialize the copy list.  However,
  1078. '** =======  if you leave the code as is (don't touch it at all),
  1079. '**          it will probably work for you. Copy list must be initialized.
  1080. '**          CAUTION: Make sure that your toplevel section in the
  1081. '**                   acronym.SCR has a keyword of "acronymTOP"
  1082. '**
  1083. '** In Symbols : 
  1084. '** Out Symbols: 
  1085. '**            
  1086. '** Arguments:  All paremeters are **read only**. 
  1087. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1088. '**                   toolkit in the order in which you were registered.
  1089. '**                   When your product is part of SmartSuite, SmartSuite
  1090. '**                   will always be product #1. (prodno% >=1)
  1091. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1092. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  1093. '**                      then step backwards
  1094. '**     
  1095. '** Errors:    No return code for errors, you must Raise them
  1096. '** Author:    MMeth
  1097. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  1098. '**                             allow the user to step backwards.)
  1099. '**
  1100. '*************************************************************************
  1101.  
  1102. PUBLIC FUNCTION InitCopyListNOT (prodno%, network$, direction$) AS STRING
  1103. DIM i%, sym$, chpt$, nextprod$, notused%, FeatureToFind$, Platform%, ChapterNumber$
  1104. DIM NetNotesChapter$, NotesIniChapter$, Dum%, szKey$, regStatus&, ThisSystem$
  1105. DIM gInstallIniFile$, prodbasedir$, cwd$, TmpInstallIni$, exedir$, TmpChapter$
  1106.  
  1107. ON Error STFQUIT GOTO COPYLISTERROR
  1108.  
  1109.     ''       ****** Language Install Code ******
  1110.    '' For each component that will have language subdirectories for the
  1111.    '' non-primary language, set the symbols appropriately
  1112.    If GetSymbolValue(SYM_INSTALLKIND$) = gLANGUAGEINSTALL$ Then
  1113.  
  1114.     '' For content, that will have separate subdirectories for non-primary language
  1115.     '' versions, call this function for a language install
  1116.       SetLanguageSubdir "NOTLANGDIR", "NOTDIR"
  1117.    Else
  1118.     '' For non-language install, they will all go into the same directory
  1119.     '' same directory, for example:
  1120.       SetSymbolValue "NOTLANGDIR", GetSymbolValue("NOTDIR")
  1121.    End if
  1122.  
  1123.  
  1124.    InitCopyListNOT = direction$
  1125.    '' In the backwards case, keep backing up
  1126.     If direction$ = gBACK Then
  1127.         '** Reset the gPartitioned global to it's orignal
  1128.         if gDebugPartition = 1 THEN PRINT "Resetting gPartitioned global because user went gBack"
  1129.         gPartitioned% = gPartitionsInstalled%
  1130.         EXIT FUNCTION
  1131.    END IF
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.     SELECT CASE Reg_GetProdSelectedInstallType(prodno%)
  1172.  
  1173.     CASE gCOMPLETE$
  1174.         i% = F_COMPLETE
  1175.         if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "User selected Server Install"
  1176.         gKitType = "2"            '' Complete default to server
  1177.  
  1178.     CASE gLAPTOP$
  1179.         i% = F_LAPTOP
  1180.         if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "User selected Workstation Install"
  1181.         gKitType$ = "1"        '' Laptop default to Client
  1182.     CASE gCUSTOM$
  1183.         i% = F_CUSTOM    
  1184.         if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "User selected Custom Install"
  1185.  
  1186.         ''** In the custom mode we must determine if the user selected
  1187.         ''** a server install so we can set Kittype.
  1188.    END SELECT
  1189.     
  1190.  
  1191.  
  1192. RECALC:
  1193.  
  1194.     sym$ = Reg_GetProductAcronym(prodno%) + gTOP$
  1195.     chpt$ = Lot_GetChapterFromKeyWord(sym$)
  1196.     IF chpt$ = "" THEN
  1197.         ERROR STFQUIT
  1198.     END IF
  1199.  
  1200.     Lot_InitializeCopyList chpt$, i%
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.     '** Default the following 2 sections to OFF on a client install but allow the user to override.    
  1211.     notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("DOCUMENTATION"),OUTOFLIST)
  1212.     notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESHELP"),OUTOFLIST)
  1213.  
  1214.  
  1215.  
  1216.     IF gNotesIni$ <> "" THEN 
  1217.         '** If we have a notes.ini here then don't install one now.
  1218.         if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ is not blank in InitCopyListNOT"
  1219.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESINI"),OUTOFLIST)
  1220.         if gDebugNotesIni = 1 THEN PRINT "Return from turning off notes.ini is :"+STR$(notused%)
  1221.  
  1222.     END IF
  1223.  
  1224.     IF ((network$ = gSTANDARD$) OR (network$ = gNODE$) OR (network$ = gSERVER)) THEN
  1225.         '** Find out the type of system and the OS
  1226.         ThisSystem$ = Environ("PROCESSOR_ARCHITECTURE")
  1227.         Platform% = WhatPlatform()
  1228.  
  1229.         if gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Platform is "+STR$(Platform%)
  1230.         if gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Processor is "+ThisSystem$
  1231.  
  1232.  
  1233.         '** ALPHA ONLY 
  1234.         '** If this is an ALPHA system then turn off(Don't display!) the section listed below.
  1235.         IF ThisSystem$ = "ALPHA" THEN
  1236.             '** Notes viewers are not supported on ALPHA.
  1237.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESVIEWER"),F_DISPLAY,INVISIBLE)
  1238.         ELSE
  1239.             '** Force the viewers to be installed if the user selects to install SMTP on _x86_ only !
  1240.             chpt$ = Lot_GetChapterFromKeyword("NOTESSMTP")
  1241.             IF Lot_GetChapterValInt(chpt$,F_DISPLAY) = VISIBLE  AND _
  1242.                 Lot_GetChapterValInt(chpt$,F_INOROUT) = INLIST THEN
  1243.                 notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESVIEWER"),F_INOROUT,INLIST)
  1244.             END IF
  1245.         END IF
  1246.  
  1247.  
  1248.         '** W95 ONLY 
  1249.         '** If this is W95 then turn off all sections not avaiable on W95
  1250.         '** If this platfom is Win95
  1251.         IF (Platform% = PLATFORM_WIN95) THEN
  1252.             IF gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Platform is Win 95"
  1253.  
  1254.             '** Don't display the following sections on W95
  1255.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESERVICE"),F_DISPLAY,INVISIBLE)
  1256.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESAUTOLOGON"),F_DISPLAY,INVISIBLE)
  1257.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NTDIRSYNC"),F_DISPLAY,INVISIBLE)
  1258.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESPERF"),F_DISPLAY,INVISIBLE)
  1259.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("PARTITION"),F_DISPLAY,INVISIBLE)
  1260.             
  1261.             '** Turn off the following sections on W95
  1262.             IF Platform% = PLATFORM_WIN95 THEN
  1263.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESPROGRAMWINNT"),OUTOFLIST)
  1264.             END IF
  1265.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESPERF"),OUTOFLIST)
  1266.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("ADVSERVER"),OUTOFLIST)
  1267.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("PARTITION"),OUTOFLIST)
  1268.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("ADVANCEDSERVICE"),OUTOFLIST)
  1269.  
  1270.         END IF
  1271.  
  1272.         IF ((network$ = gNODE$) OR (network$ = gSERVER)) THEN
  1273.             '** Do Not allow the Node user or the Administrator to install the following services for Nodes.
  1274.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESERVICE"),F_DISPLAY,INVISIBLE)
  1275.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESAUTOLOGON"),F_DISPLAY,INVISIBLE)
  1276.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NTDIRSYNC"),F_DISPLAY,INVISIBLE)
  1277.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESPERF"),F_DISPLAY,INVISIBLE)
  1278.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("PARTITION"),F_DISPLAY,INVISIBLE)
  1279.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESSERVER"),F_DISPLAY,INVISIBLE)
  1280.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESERVERDATA"),F_DISPLAY,INVISIBLE)
  1281.              notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("ADVSERVER"),F_DISPLAY,INVISIBLE)
  1282.         END IF
  1283.  
  1284.         '** If this is not W95 then do the following:
  1285.         IF Platform% <> PLATFORM_WIN95 THEN
  1286.                     '** This is not Win95 so turn off Win95 specific sections.
  1287.             if gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Platform is Winnt or Alpha"
  1288.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESPROGRAMWIN95"),OUTOFLIST)
  1289.         
  1290.             '** NOTES PERFORMANCE MONITOR COUNTERS.
  1291.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESPERF"),OUTOFLIST)
  1292.  
  1293.             '** NOTES/WINNT LOGON SYNCRONIZATION.
  1294.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESAUTOLOGON"),OUTOFLIST)
  1295.  
  1296.             '** NT DIRECTORY SYNCRONIZATION
  1297.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NTDIRSYNC"),OUTOFLIST)
  1298.  
  1299.             '** NOTES AS AN NT SERVICE.
  1300.             IF gPartitioned% = 1 THEN
  1301.                 '** On Partioned Server don't install NOTESSERVICE
  1302.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESERVICE"),OUTOFLIST)
  1303.             END IF
  1304.  
  1305.  
  1306.             IF gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Platform is NT"
  1307.  
  1308.             '** Nt x86 or Alpha
  1309.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("ADVANCEDSERVER"),F_INOROUT,INLIST)
  1310.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("ADVANCEDSERVICES"),F_INOROUT,INLIST)
  1311.  
  1312.             '** If Partitioned Server is selected then turn
  1313.             '** off the installation of "notes.ini" in the system dir.
  1314.             NetNotesChapter$ = Lot_GetChapterFromKeyword("PARTITON")
  1315.             IF Lot_GetChapterValInt(NetNotesChapter$,F_DISPLAY) = VISIBLE  AND _
  1316.                     Lot_GetChapterValInt(NetNotesChapter$,F_INOROUT) = INLIST THEN
  1317.                 if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because we are installing a partitioned server"
  1318.                 dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyword("NOTESINI"),OUTOFLIST)
  1319.             END IF
  1320.  
  1321.             '** If this is a Service Grade Install, then don't install Notes.ini the normal way (i.e. in the system dir)
  1322.             '** and be sure to turn off all the correct sections,
  1323.             IF gPartitioned% = 1 THEN
  1324.                 if gDebugPartition = 1 THEN PRINT "Setting up for second partitioned server Install"
  1325.  
  1326.                 '** On the second pass through Don't select the Program Files.
  1327.                 '** Make Notes Server selection de-selected
  1328.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESSERVER")
  1329.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, OUTOFLIST)
  1330.  
  1331.                 '** Make Notes Server Program Data selection selected, keep in mind this section is hidden.
  1332.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESSERVERDATA")
  1333.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, INLIST)
  1334.  
  1335.                 '** Make Notes Program selection de-selected
  1336.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESPROGRAM")
  1337.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, OUTOFLIST)
  1338.  
  1339.                 '** Make Notes Program Data selection selected, keep in mind this section is hidden.
  1340.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESPROGRAMDATA")
  1341.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, INLIST)
  1342.  
  1343.                 '** Make Notes International dictionaries selection OFF.
  1344.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESINTLDIC")
  1345.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, OUTOFLIST)
  1346.  
  1347.                 '** Make Notes viewers selection de-selected
  1348.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESVIEWER")
  1349.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, OUTOFLIST)
  1350.  
  1351.                 '** Make Notes viewers selection de-selected
  1352.                 ChapterNumber$ = Lot_GetChapterFromKeyword("NOTESBROWSER")
  1353.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, OUTOFLIST)
  1354.  
  1355.  
  1356.                 '** Turn ON Partition for Second install
  1357.                 ChapterNumber$ = Lot_GetChapterFromKeyword("PARTITION")
  1358.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, INLIST)
  1359.                 if gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Return SetChapterFileInCopyListInOrOut for PARTITION :"+STR$(notused%)
  1360.  
  1361.                 '** Turn ON Advanced Service Data on for Second Partition
  1362.                 ChapterNumber$ = Lot_GetChapterFromKeyword("ADVANCEDSERVICEDATA")
  1363.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (ChapterNumber$, INLIST)
  1364.                 dum% = Lot_GetChapterValInt(ChapterNumber$,F_INOROUT)
  1365.                 if gDebugInitCopyList = 1 OR gDebugNotes = 1 THEN PRINT "Return SetChapterFileInCopyListInOrOut for ADVANCEDSERVICEDATA :"+STR$(notused%)
  1366.  
  1367.  
  1368.             if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ is not blank"
  1369.                 notused% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyword("NOTESINI"),OUTOFLIST)
  1370.                 if gDebugInitCopyList = 1 OR gDebugNotesIni = 1 THEN PRINT "'Notes.ini' will not be installed on this system, Partitions are ON"
  1371.             END IF        
  1372.  
  1373.         END IF '** Platform Check.    
  1374.     END IF '** gSTANDARD$ or gNETWORK$ 
  1375.         
  1376.    ''       ****** Language Install Code ******
  1377.    '' We need to explicitly turn on all language sections for the current
  1378.    '' language, those whose keyword suffix matches language "LANG??" 
  1379.    Lot_SetLanguageSectionsOn(prodno%)
  1380.  
  1381.    '** Make sure to turn off all sections not available on the NODE Install.
  1382.     IF network$ = gNODE THEN
  1383.         nextprod$ = Lot_GetNextSibling(chpt$, F_NOTHING)  
  1384.         chpt$ = Lot_GetFirst(chpt$, F_KEYWORD)  
  1385.         WHILE (chpt$ <> "" AND chpt$ <> nextprod$)
  1386.             FeatureToFind$ = Lot_GetChapterValStr(chpt$, F_KEYWORD)
  1387.             IF Lot_IsTheFeatureInstalled(FeatureToFind$) = FALSE THEN
  1388.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (chpt$, OUTOFLIST)
  1389.             END IF
  1390.             chpt$ = Lot_GetNext() 
  1391.         WEND
  1392.    END IF
  1393.  
  1394.     SELECT CASE Reg_GetProdSelectedInstallType(prodno%)
  1395.  
  1396.     CASE gCOMPLETE$
  1397.  
  1398.  
  1399.         '** Designer Client Default install
  1400.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE3"),INLIST)
  1401.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE4"),INLIST)
  1402.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE5"),OUTOFLIST)
  1403.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE6"),INLIST)
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.     CASE gLAPTOP$
  1414.  
  1415.     '** Standard default Install
  1416.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE3"),INLIST)
  1417.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE4"),INLIST)
  1418.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE5"),OUTOFLIST)
  1419.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESTEMPLATE6"),OUTOFLIST)
  1420.         '** On a Standard Client install don't show or allow the Designer stuff to install.
  1421.         IF network$ <> gNODE THEN
  1422.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGN"),OUTOFLIST)
  1423.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNDATA"),OUTOFLIST)
  1424.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNTUT"),OUTOFLIST)
  1425.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),OUTOFLIST)
  1426.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("WEBDESIGN"),F_DISPLAY,INVISIBLE)
  1427.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("WEBDESIGNDATA"),F_DISPLAY,INVISIBLE)
  1428.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("WEBDESIGNTUT"),F_DISPLAY,INVISIBLE)
  1429.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),F_DISPLAY,INVISIBLE)
  1430.         END IF
  1431.  
  1432.         '** Laptop is Domino Server
  1433.  
  1434.     CASE gCUSTOM$
  1435.         '** always default the followin 2 as Not checked.
  1436.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESINTLDIC"),OUTOFLIST)
  1437.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESAUTOLOGON"),OUTOFLIST)
  1438.  
  1439.         '** Default Webdesign to OFF
  1440.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGN"),OUTOFLIST)
  1441.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNDATA"),OUTOFLIST)
  1442.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNTUT"),OUTOFLIST)
  1443.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),OUTOFLIST)
  1444.  
  1445.         '** In the custom install if the user de-selects Webdesign turn off the following sections.
  1446.         chpt$ = Lot_GetChapterFromKeyword("WEBDESIGN")
  1447.         IF Lot_GetChapterValInt(chpt$,F_INOROUT) = INLIST THEN
  1448.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),INLIST)
  1449.         ELSE                
  1450.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),OUTOFLIST)
  1451.         END IF
  1452.  
  1453.    END SELECT
  1454.  
  1455.     IF network$ = gNODE THEN
  1456.         TmpChapter$ = Lot_GetChapterFromKeyWord("WEBDESIGN")
  1457.         TmpChapter$=Lot_GetChapterValStr(TmpChapter$,F_KEYWORD)
  1458.         IF Lot_IsTheFeatureInstalled(TmpChapter$) <> FALSE THEN
  1459.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGN"),OUTOFLIST)
  1460.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNTUT"),INLIST)
  1461.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNDATA"),INLIST)
  1462.             notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("WEBDESIGNSAMPLE"),INLIST)
  1463.         END IF
  1464.     END IF
  1465.  
  1466.    EXIT FUNCTION
  1467.  
  1468. COPYLISTERROR:
  1469.    ErrorMsg 0, "Developers: You need to have licenser section with NOTTOP in INF file"
  1470.    ERROR STFQUIT
  1471.  
  1472. END FUNCTION
  1473.  
  1474.  
  1475. '*************************************************************************
  1476. '** FUNCTION UINOT (prodno%, network$, direction$) AS STRING
  1477. '**
  1478. '** Purpose: This is your chance to put up any User Interface
  1479. '**          that you want.  Remember, try to keep it short.
  1480. '**          In SmartSuite, if every product puts up two extra
  1481. '**          dialogs, then the SmartSuite will consist of 16 dialogs!
  1482. '**          
  1483. '**          Pay attention to the value of direction, if you are putting
  1484. '**          up more than one dialog.
  1485. '**
  1486. '**          The toolkit will do an accurate space computation later,
  1487. '**          so you can tamper with the copy list. But you shouldn't
  1488. '**          write out anything to the disk until PostCopyCofig!
  1489. '**   
  1490. '** In Symbols : 
  1491. '** Out Symbols: 
  1492. '**            
  1493. '** Arguments:  All paremeters are **read only**. 
  1494. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1495. '**                   toolkit in the order in which you were registered.
  1496. '**                   When your product is oart of SmartSuite, SmartSuite
  1497. '**                   will always be product #1. (prodno% >=1)
  1498. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1499. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  1500. '**                      then step backwards
  1501. '**     
  1502. '** Errors:    No return code for errors, you must Raise them
  1503. '** Author:    MMeth
  1504. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  1505. '**                             allow the user to step backwards.)
  1506. '**
  1507. '*************************************************************************
  1508.  
  1509.  
  1510. PUBLIC FUNCTION UINOT (prodno%, network$, direction$) AS STRING
  1511.  
  1512.  
  1513.    UINOT = direction$
  1514.    '' In the backwards case, keep backing up
  1515.    If direction$ = gBACK Then
  1516.       EXIT FUNCTION
  1517.    END IF
  1518.  
  1519.  
  1520.     if gNotesProg$ <> "" Then
  1521.         IF direction$ = gBACK Then
  1522.             UINOT$ = gBACK
  1523.             EXIT FUNCTION
  1524.         END IF
  1525.     END IF
  1526.         
  1527.  
  1528.     IF direction$ = gBACK Then
  1529.         UINOT$ = gBACK
  1530.         EXIT FUNCTION
  1531.     END IF
  1532.  
  1533. END FUNCTION
  1534.  
  1535.  
  1536.  
  1537.  
  1538. '*************************************************************************
  1539. '** FUNCTION PreCopyConfigNOT (prodno%, network$, direction$, lic%) AS STRING
  1540. '**
  1541. '** Purpose: This is the very last function called before the space is
  1542. '**          accurately computed (to the last byte) and files are copied
  1543. '**          by the toolkit.  If you have any last minute changes to
  1544. '**          do, this is the time to do them.  example:
  1545. '**          Test for monitor resolution, and turn on the chapter
  1546. '**          in the copy list (a memory residident version of the INF file)
  1547. '**          with the appropriate resolution.
  1548. '**          
  1549. '** In Symbols : 
  1550. '** Out Symbols: 
  1551. '**            
  1552. '** Arguments:  All paremeters are **read only**. 
  1553. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1554. '**                   toolkit in the order in which you were registered.
  1555. '**                   When your product is part of SmartSuite, SmartSuite
  1556. '**                   will always be product #1. (prodno% >=1)
  1557. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1558. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  1559. '**                      then step backwards
  1560. '**             lic%: TRUE | FALSE; TRUE licensing is turned on else it is off
  1561. '**     
  1562. '** Errors:    No return code for errors, you must Raise them
  1563. '** Author:    MMeth
  1564. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  1565. '**                             allow the user to step backwards.)
  1566. '**
  1567. '*************************************************************************
  1568.  
  1569. PUBLIC FUNCTION PreCopyConfigNOT (prodno%, network$, direction$, lic%) AS STRING
  1570.     DIM dum%, notused%, RCDialog$, temp$, chapter$, product_name$, child$
  1571.     DIM ModemFile$, szDestFile$, rc%, szSourceFile$, ErrCode, Tmp$ ,ShellResult%
  1572.  
  1573.     ON Error RESUME NEXT
  1574.  
  1575.    PreCopyConfigNOT = direction$
  1576.  
  1577.     IF network$ <> gDISTRIBUTION$ Then
  1578.        direction$ = GetObsoleteFiles(direction$)
  1579.     END IF
  1580.     '' In the backwards case, keep backing up
  1581.     IF direction$ = gBACK Then
  1582.         EXIT FUNCTION
  1583.     END IF
  1584.  
  1585.     ''** Tell the toolkit how many billboards you will have during file copy.
  1586.     ''** This way the toolkit will be able to calculate how long each billboard
  1587.     ''** should stay up
  1588.         '** ALWAYS Remove the gina.dll from the registry on install
  1589.         IF Environ("PROCESSOR_ARCHITECTURE") = "ALPHA" THEN
  1590.             tmp$ = GetSymbolValue("NOTDIR")+"a"+"slinst.exe -d"
  1591.             if gDebugNotesSingleLogon% = 1 THEN print "SingleLogon string is :"+tmp$
  1592.             ShellResult% = SHELL(tmp$,0)
  1593.         ELSE
  1594.             tmp$ = GetSymbolValue("NOTDIR")+"n"+"slinst.exe -d"
  1595.             if gDebugNotesSingleLogon% = 1 THEN print "SingleLogon string is :"+tmp$
  1596.             ShellResult% = SHELL(tmp$,0)
  1597.         END IF
  1598.     IF network$ = gDISTRIBUTION$ Then
  1599.         Reg_SetBillboardNumber prodno%, NUMOFBILLBDS
  1600.         ''print "The user is here"
  1601.     ElseIf network$ = gNODE$ Then
  1602.         '** There's really no time for biilboards in a node install
  1603.         Reg_SetBillboardNumber prodno%, 0
  1604.         ''print "The user is here"
  1605.     Else
  1606.     ''** This is the default (Custom Install) .
  1607.         Reg_SetBillboardNumber prodno%, NUMOFBILLBDS
  1608.  
  1609.     END IF
  1610.  
  1611.     IF gPreviousNotesInstalled% <> 0 THEN 
  1612.         MKDIR Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\modems"
  1613.         '** Check the err code returned from MKDIR
  1614.         '**    If the error is can't create 
  1615.         ErrCode = ERR()
  1616.         IF ErrCode <> 0 THEN
  1617.             'PRINT "The error returned from MKDIR is :"+STR$(ErrCode)
  1618.             ModemFile$ = DIR$(gNotesData$+"*.mdm",0)
  1619.  
  1620.             DO WHILE ModemFile <> ""
  1621.                 szDestFile$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\modems\"+ModemFile$
  1622.                 szSourceFile$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\"+ModemFile$
  1623.                 CopyFile szSourceFile$, szDestFile$, cmoCopy, 0
  1624.                 RemoveFile szSourceFile$, cmoNone
  1625.                 ModemFile = DIR$()
  1626.             LOOP
  1627.  
  1628.         END IF
  1629.     
  1630.     END IF
  1631.     IF gDebugNotes% = 1 THEN DumpCopyList "C:\tmp\copylst.dmp"
  1632. END FUNCTION
  1633.  
  1634. '*************************************************************************
  1635. '** FUNCTION  AddTheBillBoardsNOT (prodno%, network$, direction$, nbytes&)
  1636. '**
  1637. '** Purpose: This is where to add the billboards using the function:
  1638. '**          AddToBillboardList. Use nbytes& as the last parameter to
  1639. '**          the MS-SETUP function AddToBillboardList
  1640. '**
  1641. '** In Symbols : 
  1642. '** Out Symbols: 
  1643. '**            
  1644. '** Arguments:  All paremeters are **read only**. 
  1645. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1646. '**                   toolkit in the order in which you were registered.
  1647. '**                   When your product is part of SmartSuite, SmartSuite
  1648. '**                   will always be product #1. (prodno% >=1)
  1649. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1650. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  1651. '**                      then step backwards
  1652. '**           nbytes: Determines the duration of billboard timing.
  1653. '**             NOTE: Make sure to use billboard Ids that are unique to
  1654. '**                   your product. e.g. IDD_NOTBILLBD1_BMP & 
  1655. '**                   DB_NOTBILLBD1_BMP
  1656. '**     
  1657. '** Errors:    No return code for errors, you must Raise them
  1658. '** Author:    MMeth
  1659. '** Returns:   return: gNEXT |  gBACK (If you are showing UI and you
  1660. '**                             allow the user to step backwards.)
  1661. '**
  1662. '*************************************************************************
  1663.  
  1664. PUBLIC FUNCTION AddTheBillBoardsNOT (prodno%, network$, direction$, nbytes&) AS STRING
  1665.  
  1666.    AddTheBillBoardsNOT = direction$
  1667.    '' In the backwards case, keep backing up
  1668.    If direction$ = gBACK Then
  1669.       EXIT FUNCTION
  1670.    END IF
  1671.  
  1672.    If network$ = gDISTRIBUTION$ Then
  1673.       SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD1_BMP)
  1674.       SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1675.       AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD1, "FNameOrgDlgProc", nbytes&
  1676.    END IF
  1677.  
  1678.    '** There's really no time for biilboards in a node install
  1679.     If network$ <> gNODE$ Then
  1680.  
  1681.  
  1682.  
  1683.         SELECT CASE Reg_GetProdSelectedInstallType(prodno%)
  1684.  
  1685.         CASE gCOMPLETE$ ''* Designer for now.
  1686.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD1_BMP)
  1687.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1688.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD1, "FNameOrgDlgProc", nbytes& 
  1689.  
  1690.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD2_BMP)
  1691.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1692.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD2, "FNameOrgDlgProc", nbytes& 
  1693.  
  1694.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD3_BMP)
  1695.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1696.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD3, "FNameOrgDlgProc", nbytes& 
  1697.  
  1698.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD4_BMP)
  1699.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1700.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD4, "FNameOrgDlgProc", nbytes& 
  1701.  
  1702.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD5_BMP)
  1703.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1704.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD5, "FNameOrgDlgProc", nbytes& 
  1705.  
  1706.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD6_BMP)
  1707.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1708.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD6, "FNameOrgDlgProc", nbytes& 
  1709.  
  1710.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD7_BMP)
  1711.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1712.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD7, "FNameOrgDlgProc", nbytes& 
  1713.  
  1714.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD8_BMP)
  1715.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1716.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD8, "FNameOrgDlgProc", nbytes& 
  1717.  
  1718.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD9_BMP)
  1719.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1720.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD9, "FNameOrgDlgProc", nbytes& 
  1721.  
  1722.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD10_BMP)
  1723.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR1_BMP)
  1724.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD10, "FNameOrgDlgProc", nbytes& 
  1725.  
  1726.         CASE gLAPTOP$, gCUSTOM$
  1727.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD11_BMP)
  1728.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1729.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD11, "FNameOrgDlgProc", nbytes& 
  1730.  
  1731.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD12_BMP)
  1732.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1733.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD12, "FNameOrgDlgProc", nbytes& 
  1734.  
  1735.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD13_BMP)
  1736.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1737.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD13, "FNameOrgDlgProc", nbytes& 
  1738.  
  1739.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD14_BMP)
  1740.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1741.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD14, "FNameOrgDlgProc", nbytes& 
  1742.  
  1743.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD15_BMP)
  1744.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1745.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD15, "FNameOrgDlgProc", nbytes& 
  1746.  
  1747.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD16_BMP)
  1748.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1749.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD16, "FNameOrgDlgProc", nbytes& 
  1750.  
  1751.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD17_BMP)
  1752.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1753.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD17, "FNameOrgDlgProc", nbytes& 
  1754.  
  1755.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD18_BMP)
  1756.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1757.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD18, "FNameOrgDlgProc", nbytes& 
  1758.  
  1759.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD19_BMP)
  1760.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1761.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD19, "FNameOrgDlgProc", nbytes& 
  1762.  
  1763.             SetListItem "IDC_BMP", 1, STR$(IDD_BILLBD20_BMP)
  1764.             SetListItem "IDC_BMP", 2, STR$(IDD_BILLBDHDR_BMP)
  1765.             AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_BILLBD20, "FNameOrgDlgProc", nbytes& 
  1766.         END SELECT
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.    END IF
  1854.  
  1855.  
  1856.    ''''   SetListItem "IDC_BMP", 1, STR$(IDD_NOTBILLBD1_BMP)
  1857.    ''''   AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_NOTBILLBD1, "_FNameOrgDlgProc@16", nbytes& 
  1858.  
  1859. END FUNCTION
  1860.  
  1861.  
  1862. '*************************************************************************
  1863. '** FUNCTION PostCopyConfigNOT (prodno%, network$, direction$, programgroup$) AS STRING
  1864. '**
  1865. '** Purpose: This is called just after file copy has completed.
  1866. '**          This is your opportunity to do all the configuaration
  1867. '**          you need.  This includes:
  1868. '**          
  1869. '**          1. Writing to all your ini files
  1870. '**             Don't worry about ini files related to shared components
  1871. '**          2. Writing to OLE registration database
  1872. '**             Don't worry about OLE registration related to shared 
  1873. '**             components
  1874. '**          3. Writing to any other config files you may support
  1875. '**          4. Writing out user registration information,
  1876. '**             no matter how your product picks up this info
  1877. '**          5. Create any working directories
  1878. '**             A working directory is one that does not contain any
  1879. '**             files, thus the toolkit did not create it for you.
  1880. '**
  1881. '**          NOTE: THERE are many subtleties in here if you are
  1882. '**                dealing with node and CD installs.  In particular,
  1883. '**                you must be ***very*** careful to understand where the
  1884. '**                things are that you are pointing to.  They could
  1885. '**                be on the node, server, or CD!  This, in combination
  1886. '**                with the INF file for Server/Node, is probably the 
  1887. '**                trickiest part of writing a quality install.  When 
  1888. '**                configuring, you must be careful to consider what 
  1889. '**                happens if there is a pre-existing product on the 
  1890. '**                machine, in the same location or
  1891. '**                another one!  This is very very tricky.  What happens
  1892. '**                if you had a full installation previously in location C:\FOO
  1893. '**                and now the user is installing a minimum installation in loaction
  1894. '**                D:\FOO. 
  1895. '**
  1896. '**                Each and every thing you do for configuartion needs very
  1897. '**                careful thought.
  1898. '**
  1899. '**                WE support a function Lot_WhereIsFeature("FeatureID")
  1900. '**                This currrently tells you the location of a feature
  1901. '**                if the feature appears both in the SERVER.INF and the
  1902. '**                NODE.INF referred to by the same Keyword ID.
  1903. '**                We do not support CDs with this command yet, but we will 
  1904. '**                at some time.
  1905. '**
  1906. '**                Also look out for writing to a file when the directory
  1907. '**                doesn't exist.  If the user deselected one of your
  1908. '**                options, your install may still be running, but since
  1909. '**                there were no files to copy into the directory
  1910. '**                it wasn't created by the toolkit!
  1911. '**
  1912. '**                Finally, remember that configuration files generally
  1913. '**                hold the state that the user has customized earlier.
  1914. '**                Sometimes you don't want to overwrite these!
  1915. '**                You will primarily use three MS-SETUP functions
  1916. '**                in here: 
  1917. '**                1. CreateIniKeyValue  (writing to ini files)
  1918. '**                2. SetRegKeyValue     (writing to OLE reg DB)
  1919. '**
  1920. '**                CreateProgmanGroup &  ShowProgmanGroup are
  1921. '**                done for you by the time you reach this
  1922. '**                function.
  1923. '**
  1924. '**                You will not have to do any configuration of LOTUS SHARED
  1925. '**                tools.  The toolkit will do this for you.
  1926. '** In Symbols : 
  1927. '** Out Symbols: 
  1928. '**            
  1929. '** Arguments:  All paremeters are **read only**. 
  1930. '**          prodno%: This is your prodno%.  It is assigned to you by the
  1931. '**                   toolkit in the order in which you were registered.
  1932. '**                   When your product is part of SmartSuite, SmartSuite
  1933. '**                   will always be product #1. (prodno% >=1)
  1934. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  1935. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  1936. '**                      then step backwards
  1937. '**    programgroup$: The name of the program group where the user chose to
  1938. '**                   install the program manager icons     
  1939. '**
  1940. '** Errors:    No return code for errors, you must Raise them
  1941. '** Author:    MMeth
  1942. '** Returns:   return: gNEXT 
  1943. '**
  1944. '*************************************************************************
  1945.  
  1946. PUBLIC FUNCTION PostCopyConfigNOT (prodno%, network$, direction$, programgroup$) AS STRING
  1947. DIM ripath$, notused%, dum%, rval$, modenv%, ProdDir$, TmpChapter$, instance%
  1948. DIM ShellResult%, tmp$
  1949.     if gDebugNotesSingleLogon% = 1 THEN print "In Post Copy"
  1950.     
  1951.     
  1952.     TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESAUTOLOGON")
  1953.     TmpChapter$=Lot_GetChapterValStr(TmpChapter$,F_KEYWORD)
  1954.  
  1955.     IF Lot_IsTheFeatureInstalled(TmpChapter$) <> FALSE THEN
  1956.         IF gDebugNotesSingleLogon% = 1 THEN print "SingleLogon feature is installed"
  1957.  
  1958.         IF Environ("PROCESSOR_ARCHITECTURE") = "ALPHA" THEN
  1959.             tmp$ = GetSymbolValue("NOTDIR")+"a"+"slinst.exe -c "+Lot_TrimEndSlash(GetSymbolValue("NOTDIR"))
  1960.             if gDebugNotesSingleLogon% = 1 THEN print "SingleLogon string is :"+tmp$
  1961.             ShellResult% = SHELL(tmp$,0)
  1962.         ELSE
  1963.             tmp$ = GetSymbolValue("NOTDIR")+"n"+"slinst.exe -c "+Lot_TrimEndSlash(GetSymbolValue("NOTDIR"))
  1964.             if gDebugNotesSingleLogon% = 1 THEN print "SingleLogon string is :"+tmp$
  1965.             ShellResult% = SHELL(tmp$,0)
  1966.         END IF
  1967.  
  1968.         if gDebugNotesSingleLogon% = 1 THEN print "SingleLogon feature is NOT installed "+TmpChapter$
  1969.     END IF
  1970.     if gDebugNotesSingleLogon% = 1 THEN print "Finished SingleLogon "+TmpChapter$
  1971.                 
  1972.  
  1973.        '** Write product specific registry keys
  1974.      AddRegistryKeysNOT prodno%, network$
  1975.  
  1976.     PostCopyConfigNOT = direction$
  1977.     '' In the backwards case, keep backing up
  1978.     IF direction$ = gBACK Then
  1979.         EXIT FUNCTION
  1980.     END IF
  1981.  
  1982.     IF network$ <> gNODE$ Then 
  1983.         SetSymbolValue SYM_CDDRIVE$, GetSymbolValue(SYM_INSTALL_SOURCE)
  1984.     END IF
  1985.    
  1986.     ''** WRITE TO RI FILE
  1987.     ''*******************
  1988.     if GetListLength("NOTDIR") <> 0 Then
  1989.         ProdDir$ = GetListItem("NOTDIR",1)
  1990.         ripath$ = ProdDir$ +"\"+"notes.ri"
  1991.         IF Lot_WriteToRiFile (ripath$) = FALSE Then
  1992.            ErrorMsg SID_ERR_WRITERI, ripath$
  1993.         END IF
  1994.     END IF
  1995.     IF network$ = gSERVER$ OR network$ = gDISTRIBUTION Then
  1996.         GOTO SKIPCONFIG
  1997.     END IF
  1998. '    dum% = ReadInf(direction$)
  1999.  
  2000.     if gPartitioned% = 1 THEN
  2001.         if gDebugPartition = 1 THEN PRINT "Partitions are on so WritePartionedinfo."
  2002.         instance% = WritePartionedinfo(prodno%, network$)
  2003.         dum% = PartionedCmdProc(instance%)
  2004.     END IF
  2005.  
  2006.     '** Always update Notes.ini
  2007.     WriteNOTIni network$, prodno%
  2008.  
  2009.     '** Find out if were supposed to install Notes
  2010.     '** as a service, and if so then launch the
  2011.     '** service installer.
  2012.  
  2013.     TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESERVICE")
  2014.     dum%=Lot_GetChapterValInt(TmpChapter$,F_INOROUT)
  2015.     IF dum% = 1 THEN
  2016.             tmp$ = GetSymbolValue("NOTDIR")+"ntsvinst.exe -c"
  2017.             ShellResult% = SHELL(tmp$,0)
  2018.     END IF
  2019.     TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAM")
  2020.     dum%=Lot_GetChapterValInt(TmpChapter$,F_INOROUT)
  2021.     IF dum% = 1 THEN
  2022.  
  2023.  
  2024.  
  2025.         '** Write entries in win.ini
  2026.             WriteWinIni prodno%
  2027.  
  2028.         '** Log the product into \windows\lotus.ini
  2029.             WriteNOTInLotusIni prodno%
  2030.  
  2031.             WriteMAPIRegForNOT network$, prodno%
  2032.  
  2033.         '** Write the Notes registration
  2034.              dum% = WriteNotesReg(prodno%)
  2035.             'WriteOLERegForNOT network$, prodno%
  2036.  
  2037.         '** Write entries in  Program Manager
  2038.         ' WriteProgMan network$, prodno%, programgroup$
  2039.  
  2040.        '** Write the uninstaller - but only for the primary language
  2041.  
  2042.  
  2043.        If GetSymbolValue(SYM_INSTALLKIND$) <> gLANGUAGEINSTALL$ Then 
  2044.             IF network$ <> gNODE$  THEN
  2045.                 notused%=Lot_RegisterUninstaller(GetSymbolValue(SYM_REG_PRODUCTNAME$),_
  2046.                                             GetSymbolValue(SYM_REG_PRODUCTVER$),_
  2047.                                             LdString(SID_NOT_COMMERCIALNAME), _
  2048.                                             GetSymbolValue("NOTDIR")+"not.inf",_
  2049.                                             TRUE,FALSE,_
  2050.                                             GetSymbolValue(SYM_INSTALL_LANGUAGE$),_
  2051.                                             "c:\uninst.log","",_
  2052.                                             GetSymbolValue(SYM_NAME$))
  2053.  
  2054.             ELSE
  2055.                 notused%=Lot_RegisterUninstaller(GetSymbolValue(SYM_REG_PRODUCTNAME$),_
  2056.                                             GetSymbolValue(SYM_REG_PRODUCTVER$),_
  2057.                                             LdString(SID_NOT_COMMERCIALNAME), _
  2058.                                             GetSymbolValue("NOTDIR")+"notnode.inf",_
  2059.                                             TRUE,FALSE,_
  2060.                                             GetSymbolValue(SYM_INSTALL_LANGUAGE$),_
  2061.                                             "c:\uninst.log","",_
  2062.                                             GetSymbolValue(SYM_NAME$))
  2063.  
  2064.             END IF
  2065.         END IF
  2066.     END IF
  2067. SKIPCONFIG:
  2068.  
  2069.  
  2070. END FUNCTION
  2071.  
  2072. '*************************************************************************
  2073. '** PUBLIC SUB AddRegistryKeysNOT (prodno%, network$) 
  2074. '**
  2075. '** Purpose: This is called just after file copy has completed.
  2076. '**          1. Add product specific Registry Keys.
  2077. '**
  2078. '**           Each and every thing you do for configuartion needs very
  2079. '**           careful thought.
  2080. '**
  2081. '** In Symbols : 
  2082. '** Out Symbols: 
  2083. '**            
  2084. '** Arguments:  All paremeters are **read only**. 
  2085. '**          prodno%: This is your prodno%.  It is assigned to you by the
  2086. '**                   toolkit in the order in which you were registered.
  2087. '**                   When your product is part of SmartSuite, SmartSuite
  2088. '**                   will always be product #1. (prodno% >=1)
  2089. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  2090. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  2091. '**                      then step backwards
  2092. '**    programgroup$: The name of the program group where the user chose to
  2093. '**                   install the program manager icons     
  2094. '**
  2095. '** Errors:    No return code for errors, you must Raise them
  2096. '** Author:    PMD
  2097. '**
  2098. '*************************************************************************
  2099. PUBLIC SUB AddRegistryKeysNOT (prodno%, network$) 
  2100. DIM LocPath$, Filename$, exedir$, instvalue&, Update%, Platform%, ShellResult%
  2101. DIM RegStatus&, szKey$, nsize&, Buffer$, temp$, keyval$, keyval1$, keyval2&
  2102. DIM ExeName$, Description$, Path$, Version$, KeyPath$, AppName$, dum%
  2103. DIM CPath$, Insttype$, Responce%, szkey1$, Default$, datadir$, dPath$
  2104. DIM temp2$, chpt$, keyword$, NewDir$, notused%
  2105.  
  2106. Filename$ = LdString(SID_NOT_NOTES)
  2107. exedir$ = GetSymbolValue("NOTDIR")        '** Get Notes executable directory
  2108.  
  2109. ExeName$        = "Name"            '** Executable name
  2110. Description$     = "Description"        '** Description of the entry
  2111. Path$             = "Path"            '** Path to executable directory
  2112. dPath$             = "DataPath"        '** Path to data directory
  2113. Version$         = "Version"            '** Version Used for TeamMail only
  2114. KeyPath$        = "KeyPath"
  2115. AppName$        = "Application"
  2116. CPath$            = "LocalPath"
  2117. Insttype$        = "InstType"
  2118. Default$            = "Default"
  2119.  
  2120.     SELECT CASE network$
  2121.  
  2122.     CASE gSERVER$
  2123.     '** On a server Install i.e. FileServer install we want the Program and Data
  2124.  
  2125.     CASE gDISTRIBUTION$
  2126.  
  2127.     CASE gSTANDARD$
  2128.         instvalue = 0
  2129.         exedir$ = Lot_TrimEndSlash(GetSymbolValue("NOTDIR"))        '** Get Notes executable directory
  2130.         CreateIniKeyValue exedir$+"\cinstall.ini", "TOOLKIT", "LAUNCHEXE",exedir$+"\notes.exe" , cmoOverwrite    
  2131.  
  2132.     CASE gNODE$
  2133.         instvalue = 1
  2134.         exedir$ = gNodeDir$
  2135.         exedir$ = Lot_TrimEndSlash(GetSymbolValue("NOTDIR"))        '** Get Notes executable directory
  2136.         CreateIniKeyValue exedir$+"\cinstall.ini", "TOOLKIT", "LAUNCHEXE",exedir$+"\notes.exe" , cmoOverwrite    
  2137.  
  2138.     END SELECT
  2139.  
  2140.     datadir$ = GetSymbolValue("NOTWORKDIR")        '** Get Notes executable directory
  2141.     Filename$ = LdString(SID_NOT_NOTES)            '** Get the Notes File name.
  2142.  
  2143.     
  2144.     IF ((network$ = gSTANDARD$) OR (network$ = gNODE$))THEN
  2145.  
  2146.         '** If the user has selected the main program group then register 
  2147.         '** Notes in the registry.
  2148.         IF Lot_IsTheFeatureInstalled("NOTESPROGRAM") <> FALSE THEN
  2149.  
  2150.             '** Get the Notes Program path.
  2151.             locpath$ = Lot_WhereIsFeature(prodno%, "NOTESPROGRAM", LdString(SID_NOT_NOTES))
  2152.             nsize = len(LocPath$) + 1
  2153.  
  2154.             '**
  2155.             '** Remove the OLD "4.1" Notes Entry from the registry
  2156.             '**
  2157.             szKey$ = gREGLOTUS+LdString(SID_NOT_NOTES_NAME)+"\4.1" 
  2158.             regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  2159.             IF regStatus&= 1 THEN
  2160.                 IF gDebugAddReg = 1 THEN PRINT "Removing Key "+szKey$
  2161.                 regStatus&= Lot_RegDelAllSubKeys(HKEY_LOCAL_MACHINE, szKey$)
  2162.             END IF
  2163.  
  2164.             szKey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notes V4.1"
  2165.             IF gDebugAddReg = 1 THEN PRINT "Attempting to remove Key "+szKey$
  2166.             regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  2167.             IF regStatus&= 1 THEN
  2168.                 IF gDebugAddReg = 1 THEN PRINT "Removing Key "+szKey$
  2169.                 regStatus&= Lot_RegDelAllSubKeys(HKEY_LOCAL_MACHINE, szKey$)
  2170.             ELSE
  2171.                 IF gDebugAddReg = 1 THEN PRINT "remove Key "+szKey$" FAILED Registry error :"+STR$(regStatus)
  2172.             END IF
  2173.  
  2174.             '**
  2175.             '** Create the Notes Entry in the registry
  2176.             '**
  2177.             szKey$ = gREGLOTUS+GetSymbolValue(SYM_REG_PRODUCTNAME$)+"\"+GetSymbolValue(SYM_REG_PRODUCTVER$)
  2178.             keyval$ = LdString(SID_NOT_NOTES)
  2179.             keyval1$ = LdString(SID_NOT_NOTES_NAME)
  2180.  
  2181.             '** Create the registration Key
  2182.             regStatus = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$)
  2183.  
  2184.             '** Add the registry values
  2185.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, ExeName$, REG_SZ, keyval$, LEN(keyval$) + 1)
  2186.  
  2187.  
  2188.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, Description$, REG_SZ, keyval1$, LEN(keyval1$) + 1)
  2189.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, Path$, REG_SZ, exedir$+"\", LEN(exedir$) + 1)
  2190.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, dPath$, REG_SZ, datadir$, LEN(datadir$) + 1)
  2191.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, InstType$, REG_SZ, network$, LEN(network$) + 1)
  2192.  
  2193.             '** Check for errors
  2194.             IF regStatus& <> ERROR_SUCCESS THEN
  2195.                 RegErrorMsg SID_ERR_REG_NOTES, gHLM$+"\"+szKey$," Notes Registey Entry ",+STR$(regStatus&)
  2196.             END IF
  2197.  
  2198.  
  2199.             '** Remove any old Notes entry for AppPath and put the new one in.
  2200.  
  2201.             szKey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"+"\"+LdString(SID_NOT_NOTES)
  2202.             regStatus&= Lot_RegDelAllSubKeys(HKEY_LOCAL_MACHINE, szKey$)
  2203.             regStatus& = Lot_RegAppPath(FileName$, exedir$, "", FALSE, "NOTESPROGRAM")
  2204.  
  2205.             '** Get the current operating platform.
  2206.             Platform% = WhatPlatform()
  2207.  
  2208.             '**
  2209.             '** If the NT directory sync services was selected then register this option.
  2210.             '**
  2211.             IF Lot_IsTheFeatureInstalled("NTDIRSYNC") <> FALSE THEN
  2212.                 '** Only do this on the WINNT platform.
  2213.                 IF Platform% <> PLATFORM_WIN95 THEN
  2214.                     '** The Key and Object to create
  2215.                     szKey$ = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Network\UMAddOns"
  2216.                     
  2217.                     IF Environ("PROCESSOR_ARCHITECTURE") = "ALPHA" THEN
  2218.                         regStatus= Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "NUME", REG_SZ, exedir$+"a"+LdString(SID_NOT_REG_NUME), LEN(exedir$+LdString(SID_NOT_REG_NUME)) + 2)
  2219.                         IF gDebugAddReg = 1 THEN PRINT "Adding or updateing key NUME "+exedir$+"a"+LdString(SID_NOT_REG_NUME)
  2220.                         IF gDebugAddReg = 1 THEN PRINT "Registration status is "+STR$(regStatus&)
  2221.                     ELSE
  2222.                         regStatus= Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "NUME", REG_SZ, exedir$+"n"+LdString(SID_NOT_REG_NUME), LEN(exedir$+LdString(SID_NOT_REG_NUME)) + 2)
  2223.                         IF gDebugAddReg = 1 THEN PRINT "Adding or updateing key NUME "+exedir$+"n"+LdString(SID_NOT_REG_NUME)
  2224.                         IF gDebugAddReg = 1 THEN PRINT "Registration status is "+STR$(regStatus&)
  2225.                     END IF
  2226.                     regStatus&= Lot_RegisterObject("NTDIRSYNC",UNIN_CLASS_REGISTRY_HIVE$,"HKEY_LOCAL_MACHINE\"+szKey$)
  2227.                     IF regStatus& <> ERROR_SUCCESS THEN
  2228.                         RegErrorMsg SID_ERR_REG_NOTES, gHLM$+"\"+szKey$," Nt Directory sync service",STR$(regStatus&)
  2229.                     END IF
  2230.             
  2231.                 END IF
  2232.             END IF
  2233.         END IF
  2234.         
  2235.         IF (network$ = gSTANDARD$) THEN
  2236.             '**
  2237.             '** If we are installing a Notes Server then and the Performance monitor
  2238.             '** was selected then create the shell command to execute the "notesreg.bat".
  2239.             '** NEED WORK HERE look at LPW_istTheFeatureInstalled and make registry.
  2240.  
  2241.             IF Lot_IsTheFeatureInstalled("NOTESSERVER") <> FALSE THEN
  2242.                 IF Platform% <> PLATFORM_WIN95 THEN
  2243.                     IF Lot_IsTheFeatureInstalled("NOTESPERF") <> FALSE THEN
  2244.                         temp$ = exedir$+"notesreg.bat "+Lot_TrimEndSlash(exedir$)
  2245.                         IF gDebugAddReg = 1 THEN PRINT "About to execute the following :"+temp$
  2246.                         ShellResult = SHELL(temp$,0)
  2247.                     END IF
  2248.                 END IF
  2249.                 ON ERROR resume NEXT
  2250.  
  2251.                 '** Create the paths if they don't exist
  2252.                 '** and register the directory under the first product
  2253.  
  2254.                 '** Make sure the following directories exist on the Notes Server.
  2255.                 '** and register them so the un-installer can remove them.
  2256.                 keyword$ = Lot_GetChapterValStr(_
  2257.                             Lot_GetChapterFromKeyword(Reg_GetProductAcronym(1) + gTOP$), F_KEYWORD)   
  2258.                 
  2259.                 NewDir$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\html"
  2260.                 IF NOT DoesDirExist(NewDir$) THEN
  2261.                     Lot_CreateDirectory(NewDir$)
  2262.                     notused% = Lot_RegisterObject (keyword$,UNIN_CLASS_DIRECTORY$, NewDir$)
  2263.                 END IF
  2264.  
  2265.                 NewDir$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\cgi-bin"
  2266.                 IF NOT DoesDirExist(NewDir$) THEN
  2267.                     Lot_CreateDirectory(NewDir$)
  2268.                     notused% = Lot_RegisterObject (keyword$,UNIN_CLASS_DIRECTORY$, NewDir$)
  2269.                 END IF
  2270.  
  2271.                 temp$ = DIR$(Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\admin-bin\*.exe", 0)
  2272.                 DO WHILE temp$  <> ""
  2273.                     kill(Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\admin-bin\"+temp$)
  2274.                     temp$ = DIR$()
  2275.                     temp2$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\admin-bin\"+temp$
  2276.                 LOOP
  2277.                 RMDIR(Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\domino\admin-bin")
  2278.             END IF
  2279.         END IF
  2280.  
  2281.     '**
  2282.     '** Create the LocalPath entry for the components dir.
  2283.     '**
  2284.  
  2285.         szKey$ = gREGLOTUS+LdString(SID_NOT_REG_COMPONENTS)
  2286.  
  2287.         '** Find out if the Components LocalPath is set if it's not set set to NULL
  2288.         '** if it is set then don't do anything at all otherwise we might break
  2289.         '** some other component. (Notes: has no use for this setting but it must
  2290.         '** be set for the Uninstaller to work properly.
  2291.  
  2292.         regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  2293.  
  2294.         IF regStatus&= 1 then
  2295.             IF gDebugAddReg = 1 THEN PRINT "Regstatus for Localpath is 1"
  2296.             regStatus =  Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LocPath$, 0, buffer$, nsize) 
  2297.         ELSE
  2298.             IF gDebugAddReg = 1 THEN PRINT "RegStatus for localpath is not 1"
  2299.             regStatus = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$)
  2300.             regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, CPath$, REG_SZ, "", 1)
  2301.         END IF    
  2302.  
  2303.     '**
  2304.     '** Update/Add Shared dll entries
  2305.     '**
  2306.     '   IF Lot_IsTheFeatureInstalled("NOTESPROGRAMWINNT") <> FALSE THEN
  2307.     '        szKey$ = "SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDlls"
  2308.     '        regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  2309.     '
  2310.     '   ELSE IF Lot_IsTheFeatureInstalled("NOTESPROGRAMWIN95") <> FALSE THEN
  2311.            
  2312.  
  2313.     '**
  2314.     '** Create the LotusScriptExtensions Entry in the registry
  2315.     '**
  2316.  
  2317.         szKey$ = gREGLOTUS+LdString(SID_NOT_REG_COMPONENTS)+"\"+LdString(SID_NOT_LS_EXTENSIONS)+"\"+LdString(SID_NOT_LS_VERSION)
  2318.  
  2319.         temp$ = GetSymbolValue("NOTDIR")+"nlsxbe.dll"
  2320.         nsize = LEN(temp$)
  2321.  
  2322.         regStatus = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$)
  2323.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "NOTES", REG_SZ, temp$, nsize + 1)
  2324.  
  2325.         temp$ = GetSymbolValue("NOTDIR")+"nlsxodbc.dll"
  2326.         nsize = LEN(temp$)
  2327.  
  2328.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "LSXODBC", REG_SZ, temp$, nsize + 1)
  2329.  
  2330.         IF regStatus& <> ERROR_SUCCESS THEN
  2331.             RegErrorMsg SID_ERR_REG_LSEXT, gHLM$+"\"+szKey$,"Lotus Script Extensions",STR$(regStatus&)
  2332.         END IF
  2333.  
  2334.         regStatus&= Lot_RegisterObject("NOTESPROGRAM",UNIN_CLASS_REGISTRY_HIVE$,"HKEY_LOCAL_MACHINE\"+szKey$)
  2335.  
  2336.     '**
  2337.     '** Create the TeamMail Mail Entry in the registry
  2338.     '**
  2339.  
  2340.         szKey$ = gREGLOTUS+LdString(SID_NOT_REG_COMPONENTS)+"\"+LdString(SID_NOT_REG_TEAM_MAIL)
  2341.         keyval$ = LdString(SID_NOT_DSC_TEAM_MAIL)
  2342.         keyval1$ = LdString(SID_NOT_REG_NOTES_NAME)
  2343.         szKey1$ =gREGLOTUS+GetSymbolValue(SYM_REG_PRODUCTNAME$)+"\"+GetSymbolValue(SYM_REG_PRODUCTVER$)
  2344.         regStatus& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$)
  2345.  
  2346.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, Description$, REG_SZ, keyval$, LEN(keyval$) + 1)
  2347.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, Version$, REG_SZ,"1.0" , LEN("1.0") + 1)
  2348.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, KeyPath$, REG_SZ,  szKey1$, LEN(szKey1$) + 1)
  2349.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, AppName$, REG_SZ,  keyval1$, LEN(keyval1$) + 1)
  2350.         IF regStatus& <> ERROR_SUCCESS THEN
  2351.             RegErrorMsg SID_ERR_REG_TM, gHLM$+"\"+szKey$,"",""
  2352.         END IF
  2353. '** Removal of _X86_ only code
  2354.  
  2355.         '** Find out if a Debugger is already installed, If it's QNC.exe or Dr. Watson then 
  2356.         '** update it otherwise leave the current debugger alone.
  2357.  
  2358.         '**
  2359.         '** Create the QNC entry in the registry
  2360.         '**
  2361.         IF gDebugAddReg = 1 THEN PRINT "Registering QNC"
  2362.  
  2363.         '** Load the dafault registry key string for the debugger
  2364.         szKey$ = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug"
  2365.  
  2366.         '** Check to see if the key exists.
  2367.         regStatus& = Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  2368.         IF gDebugAddReg = 1 THEN PRINT "Regstatus for :"+szKey$" is "+STR$(regStatus&)
  2369.  
  2370.         '** If the key does exist, then check to see if it's QNC or Dr. Watson.
  2371.         '** If it's one of the 2 then Updated the debugger to point to the location
  2372.         '** of QNC. If it's any other debugger then do nothing here. 
  2373.  
  2374.         IF regStatus& = 1 THEN
  2375.             regStatus& =  Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "Debugger", 0, buffer$, MAXKEYPATH)
  2376.  
  2377.             IF gDebugAddReg = 1 THEN PRINT "Currently installed debugger is :"+Buffer$
  2378.             
  2379.             IF INSTR(Buffer$,LdString(SID_NOT_QNC)) <> 0 OR INSTR(Buffer$,LdString(SID_NOT_DRWTSN)) <> 0 THEN
  2380.                 Update% = 1
  2381.                 IF gDebugAddReg = 1 THEN PRINT "Dr Watson installed so update with QNC"
  2382.                 IF gDebugAddReg = 1 THEN PRINT "Updateing QNC, or overwritting DR. Watson"
  2383.             ELSE
  2384.                 Update% = 0
  2385.             END IF
  2386.  
  2387.         ELSE    '** Add QNC as the debugger
  2388.             Update% = 1
  2389.             IF gDebugAddReg = 1 THEN PRINT "Adding QNC"
  2390.         END IF
  2391.  
  2392.         IF Update% = 1 THEN
  2393.  
  2394.             '** Find out if QNC Go installed.
  2395.             responce% = Lot_IsTheFeatureInstalled("NOTESQNC")
  2396.             IF gDebugAddReg = 1 THEN PRINT "QNC Status is "+STR$(responce%)
  2397.  
  2398.             '** If QNC was installed then add the information to the registry.
  2399.             if responce% = 1 THEN
  2400.  
  2401.                 '** IF the key "AEDEBUG" didn't exist then this is were we will create it.
  2402.                 if Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$) = 0 THEN
  2403.                     regStatus& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey$)
  2404.                 END IF
  2405.                 '** Now create the key values for "AEDEBUG".
  2406.  
  2407.                 '** Key "Auto"
  2408.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "Auto", REG_SZ, "0", LEN("0") + 1)
  2409.  
  2410.                 '** QNC Key value for Auto.
  2411.                 keyval$ = exedir$+LdString(SID_NOT_QNC)+" "+LdString(SID_NOT_QNC_OPTIONS)
  2412.  
  2413.                 '** Key "Debugger"
  2414.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "Debugger", REG_SZ, keyval$, LEN(keyval$) + 1)
  2415.  
  2416.                 '** register the object so the un-installer can remove it when Notes goes away.
  2417.                 'regStatus&= Lot_RegisterObject("NOTESQNC",UNIN_CLASS_REGISTRY_HIVE$,szKey$)
  2418.  
  2419.                 '** Check to see if an error has occured, if so display the error to the user.
  2420.                 IF regStatus& <> ERROR_SUCCESS THEN
  2421.                     RegErrorMsg SID_NOT_QNC_REG, gHLM$+"\"+szKey$,"",""
  2422.                 END IF
  2423.  
  2424.                 '** Load the name of the dubbger we are installing.
  2425.                 szKey$ = gREGLOTUS+LdString(SID_NOT_QNC_REG)
  2426.  
  2427.                 '** Register the Debugger with un-install
  2428.                 'regStatus&= Lot_RegisterObject("NOTESQNC",UNIN_CLASS_REGISTRY_KEY$,szKey$)
  2429.  
  2430.                 IF gDebugAddReg = 1 THEN PRINT "Key to create is"+szKey$
  2431.                 '** Find out if the entry for Quinsy exists.
  2432.                 if Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$) = 0 THEN
  2433.                     regStatus& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey$)
  2434.                 END IF
  2435.  
  2436.                 regStatus& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE,szKey$)
  2437.                 IF regStatus& <> ERROR_SUCCESS THEN
  2438.                     RegErrorMsg SID_NOT_QNC_REG, gHLM$+"\"+szKey$,STR$(regStatus),""
  2439.                 END IF
  2440.                 keyval2& = 00000000
  2441.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_NUMCRASH), REG_DWORD, keyval2&, 4)
  2442.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_LOGFILPATH), REG_SZ,"",LEN("") + 1)
  2443.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_WAVEFILE), REG_SZ, "",LEN("") + 1)
  2444.                 keyval2& = 00000000
  2445.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_DUMPSYM), REG_DWORD, keyval2&, 4)
  2446.                 keyval2& = 00000001
  2447.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_DUMPALLTHRDS), REG_DWORD, keyval2&, 4)
  2448.                 keyval2& = 00000001
  2449.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_APPTOLOGFILE), REG_DWORD, keyval2&, 4)
  2450.                 keyval2& = 00000001
  2451.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_VISNOTIFICATION), REG_DWORD, keyval2&, 4)
  2452.                 keyval2& = 00000001
  2453.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_SNDNOTIFICATION), REG_DWORD, keyval2&, 4)
  2454.                 keyval2& = 00000010
  2455.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_INSTRUCTIONS), REG_DWORD, keyval2&, 4)
  2456.                 keyval2& = 00000010
  2457.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_MAXCRASHES), REG_DWORD, keyval2&, 4)
  2458.                 keyval2& = 00000000
  2459.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, LdString(SID_NOT_QNC_DUMPALLMODS), REG_DWORD, keyval2&, 4)
  2460.                 IF regStatus& <> ERROR_SUCCESS THEN
  2461.                     RegErrorMsg SID_NOT_QNC_REG, gHLM$+"\"+szKey$,"",""
  2462.                 END IF
  2463.             END IF
  2464.         END IF
  2465.  
  2466.     END IF '** gNODE$ or gSTANDARD$
  2467. END SUB
  2468.  
  2469. '*************************************************************************
  2470. '** FUNCTION AddIconsNOT (prodno%, network$, direction$, programgroup$) AS STRING
  2471. '**
  2472. '** Purpose: This is called just after file copy has completed.
  2473. '**          1. Add program manager icons of those features
  2474. '**             that were installed.
  2475. '**          NOTE: THERE are many subtleties in here if you are
  2476. '**                dealing with node and CD installs.  In particular,
  2477. '**                you must be ***very*** careful to understand where the
  2478. '**                things are that you are pointing to.  They could
  2479. '**                be on the node, server, or CD!  This, in combination
  2480. '**                with the INF file for Server/Node, is probably the 
  2481. '**                trickiest part of writing a quality install.  When 
  2482. '**                configuring, you must be careful to consider what 
  2483. '**                happens if there is a pre-existing product on the 
  2484. '**                machine, in the same location or
  2485. '**                another one!  This is very very tricky.  What happens
  2486. '**                if you had a full installation previously in location C:\FOO
  2487. '**                and now the user is installing a minimum installation in loaction
  2488. '**                D:\FOO. 
  2489. '**
  2490. '**                Each and every thing you do for configuartion needs very
  2491. '**                careful thought.
  2492. '**
  2493. '**                WE support a function Lot_WhereIsFeature("FeatureID")
  2494. '**                This currrently tells you the location of a feature
  2495. '**                if the feature appears both in the SERVER.INF and the
  2496. '**                NODE.INF referred to by the same Keyword ID.
  2497. '**                We do not support CDs with this command yet, but we will 
  2498. '**                at some time.
  2499. '**
  2500. '**                Also look out for writing to a file when the directory
  2501. '**                doesn't exist.  If the user deselected one of your
  2502. '**                options, your install may still be running, but since
  2503. '**                there were no files to copy into the directory
  2504. '**                it wasn't created by the toolkit!
  2505. '**
  2506. '**                Finally, remember that configuration files generally
  2507. '**                hold the state that the user has customized earlier.
  2508. '**                Sometimes you don't want to overwrite these!
  2509. '**                You will primarily use three MS-SETUP functions
  2510. '**                in here: 
  2511. '**                1. CreateProgmanItem  (writing to progman) 
  2512. '**
  2513. '**                CreateProgmanGroup &  ShowProgmanGroup are
  2514. '**                done for you by the time you reach this
  2515. '**                function.
  2516. '**
  2517. '**                You will not have to do any configuration of LOTUS SHARED
  2518. '**                tools.  The toolkit will do this for you.
  2519. '** In Symbols : 
  2520. '** Out Symbols: 
  2521. '**            
  2522. '** Arguments:  All paremeters are **read only**. 
  2523. '**          prodno%: This is your prodno%.  It is assigned to you by the
  2524. '**                   toolkit in the order in which you were registered.
  2525. '**                   When your product is part of SmartSuite, SmartSuite
  2526. '**                   will always be product #1. (prodno% >=1)
  2527. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  2528. '**       direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
  2529. '**                      then step backwards
  2530. '**    programgroup$: The name of the program group where the user chose to
  2531. '**                   install the program manager icons     
  2532. '**
  2533. '** Errors:    No return code for errors, you must Raise them
  2534. '** Author:    MZ
  2535. '** Returns:   return: gNEXT 
  2536. '**
  2537. '*************************************************************************
  2538. PUBLIC FUNCTION AddIconsNOT (prodno%, network$, direction$, programgroup$) AS STRING
  2539. DIM ripath$, exepath$, exename$, szArgument$, notused%, dum%
  2540. DIM LanguageQualifier$, LanguageAcronym$, ProgramChapter$
  2541. DIM CurrentInstance$, datapath$
  2542.  
  2543.     AddIconsNOT = direction$
  2544.     '** In the backwards case, keep backing up
  2545.     If direction$ = gBACK Then
  2546.         EXIT FUNCTION
  2547.     END IF
  2548.  
  2549.     LanguageQualifier$ =  ""
  2550.     LanguageAcronym$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$) 
  2551.     szArgument$ = "/L" + LanguageAcronym$ 
  2552.     exename$ = LdString(SID_NOT_NOTES)
  2553.     exepath$ = Lot_WhereIsFeature(prodno%, "NOTESPROGRAM", exename$)
  2554.  
  2555.     '** If language install, add qualifier
  2556.     If GetSymbolValue(SYM_INSTALLKIND$) = gLANGUAGEINSTALL$ Then _
  2557.         LanguageQualifier$ =  Lot_SetLanguageDirectory ( LanguageAcronym$ ) 
  2558.  
  2559.     '** Don't Install Icons for Shared Install.
  2560.     IF network$ <> gSERVER$ THEN
  2561.  
  2562.     '** Get the chapter name for the Notes program chapter.
  2563.     ProgramChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAM")
  2564.  
  2565.  
  2566.         IF (Lot_GetChapterValInt(ProgramChapter$, F_INOROUT) OR (gPartitioned% = 1)) THEN
  2567.             IF gDebugPartition = 1 THEN PRINT "Partitions on so install icons"
  2568.             IF IsNewShell() THEN
  2569.                 IF gPartitioned% = 1 THEN
  2570.                     IF gDebugAddIcons = 1 THEN PRINT" VClient is on"
  2571.                     datapath$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))
  2572.                     CurrentInstance$ ="Client"+STR$(gInstance%)
  2573.                     notused%=Lot_AddLinkIconToFolder(prodno%, datapath$+"\"+LdString(SID_NOT_NCLIENT), LdString(SID_NOT_COMMERCIALNAME)+" "+CurrentInstance$+".lnk", LdString(SID_NOT_COMMERCIALNAME),"",datapath$,datapath$+"\"+LdString(SID_NOT_CLIENTICON),0)
  2574.                     notused% = Lot_RegisterObject ("NOTES",UNIN_CLASS_FILE$, datapath$+"\"+LdString(SID_NOT_NCLIENT))
  2575.                 ELSE
  2576.                         '** Non Virtual Server New Shell
  2577.                     IF gDebugAddIcons = 1 THEN PRINT" Adding Notes Icon for new shell"
  2578.                     IF gDebugAddIcons = 1 THEN PRINT" Notes exepath is "+exepath$
  2579.                     IF gDebugAddIcons = 1 THEN PRINT" NotesString is "+LdString(SID_NOT_NOTES)
  2580.                     IF gDebugAddIcons = 1 THEN PRINT" Notes Commerical name is is "+LdString(SID_NOT_COMMERCIALNAME)
  2581.                     notused%=Lot_AddLinkToFolder(prodno%, exepath$+LdString(SID_NOT_NOTES), LdString(SID_NOT_COMMERCIALNAME)+".lnk", LdString(SID_NOT_COMMERCIALNAME),"",exepath$)
  2582.                 END IF
  2583.                 notused% = Lot_RegisterObject("NOTESPROGRAM",UNIN_CLASS_SHORTCUT$,Lot_GetProgFolder(prodno%)+LdString(SID_NOT_COMMERCIALNAME)+".lnk")
  2584.             ELSE
  2585.                 IF gPartitioned% = 1 THEN
  2586.                     IF gDebugAddIcons = 1 THEN PRINT" VClient is on"
  2587.                     datapath$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))
  2588.                     CurrentInstance$ ="Client"+STR$(gInstance%)
  2589.                     CreateProgmanItem  programgroup$, LdString(SID_NOT_COMMERCIALNAME)+" "+CurrentInstance$,datapath$+"\"+LdString(SID_NOT_NCLIENT),datapath$+"\"+LdString(SID_NOT_CLIENTICON), cmoOverwrite
  2590.                     notused% = Lot_RegisterObject ("NOTES",UNIN_CLASS_FILE$, datapath$+"\"+LdString(SID_NOT_NCLIENT))
  2591.                 ELSE
  2592.                     '** Non Virtual Server Old Shell
  2593.                     IF gDebugAddIcons = 1 THEN PRINT" Adding Notes Icon for old shell"
  2594.                     CreateProgmanItem  programgroup$, LdString(SID_NOT_COMMERCIALNAME),exepath$+LdString(SID_NOT_NOTES),"", cmoOverwrite
  2595.                 END IF
  2596.  
  2597.                 notused% = Lot_RegisterObject("NOTESPROGRAM", UNIN_CLASS_ICON$, programgroup$+"\"+LdString(SID_NOT_COMMERCIALNAME))
  2598.             END IF
  2599.         END IF
  2600.  
  2601.  
  2602.  
  2603.         '** Don't Install Server for Node Install
  2604.        IF network$ <> gNODE$ THEN
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.             exename$ = LdString(SID_NOT_NOTESSERVEREXE)
  2612.             exepath$ = Lot_WhereIsFeature(prodno%, "NOTESSERVER", exename$)
  2613.  
  2614.             '** check exepath because if the user reinstall the Client after
  2615.             '** doing a Server install the  Lot_WhereIsFeature would return "".
  2616.             IF exepath$ = "" THEN 
  2617.                 exepath$ = Lot_WhereIsFeature(prodno%, "NOTESPROGRAM", exename$)
  2618.             END IF
  2619.             IF gDebugAddIcons = 1 THEN PRINT" SID_NOT_NOTES is :"exename$
  2620.  
  2621.                '** Write entries in  Program Manager
  2622.                ProgramChapter$ = Lot_GetChapterFromKeyWord("NOTESSERVER")
  2623.             dum% = Lot_GetChapterValInt(ProgramChapter$, F_INOROUT)
  2624.             IF ( dum% = 1 OR  (gPartitioned% = 1)) THEN
  2625.                 IF IsNewShell() THEN
  2626.                     IF gPartitioned% = 1 THEN
  2627.                     IF gDebugAddIcons = 1 THEN PRINT" Vserver is on"
  2628.                         datapath$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))
  2629.                         CurrentInstance$ =STR$(gInstance%)
  2630.                         notused%=Lot_AddLinkIconToFolder(prodno%, datapath$+"\"+LdString(SID_NOT_NSERVER), LdString(SID_NOT_SERVER_TITLE)+CurrentInstance$+".lnk", LdString(SID_NOT_COMMERCIALNAME),"",datapath$,datapath$+"\"+LdString(SID_NOT_SERVERICON),0)
  2631.                         notused% = Lot_RegisterObject ("NOTES",UNIN_CLASS_FILE$, datapath$+"\"+LdString(SID_NOT_NSERVER))
  2632.                     ELSE
  2633.  
  2634.  
  2635.  
  2636.                         notused%=Lot_AddLinkToFolder(prodno%, exepath$+LdString(SID_NOT_SERVER), LdString(SID_NOT_SERVER_TITLE)+".lnk", LdString(SID_NOT_SERVER_TITLE),"",exepath$)
  2637.                         notused%=Lot_AddLinkToFolder(prodno%, exepath$+LdString(SID_NOT_NOTES), LdString(SID_NOT_SERVER_ADMIN_TITLE)+".lnk", LdString(SID_NOT_SERVER_ADMIN),"ADMINONLY",exepath$)
  2638.  
  2639.                     END IF
  2640.                     notused% = Lot_RegisterObject("NOTESSERVER",UNIN_CLASS_SHORTCUT$,Lot_GetProgFolder(prodno%)+LdString(SID_NOT_SERVER_TITLE)+".lnk")
  2641.                 ELSE
  2642.                     IF gPartitioned% = 1 THEN
  2643.                     IF gDebugAddIcons = 1 THEN PRINT" Vserver is on"
  2644.                         datapath$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))
  2645.                         CurrentInstance$ =STR$(gInstance%)
  2646.                         CreateProgmanItem  programgroup$, LdString(SID_NOT_SERVER_TITLE)+CurrentInstance$ ,datapath$+"\"+LdString(SID_NOT_NSERVER),datapath$+LdString(SID_NOT_SERVERICON), cmoOverwrite
  2647.                         notused% = Lot_RegisterObject ("NOTES",UNIN_CLASS_FILE$, datapath$+"\"+LdString(SID_NOT_NSERVER))
  2648.                     ELSE
  2649.  
  2650.  
  2651.  
  2652.                         CreateProgmanItem  programgroup$, LdString(SID_NOT_SERVER_TITLE) ,exepath$+LdString(SID_NOT_SERVER),"", cmoOverwrite
  2653.  
  2654.                     END IF
  2655.                     notused% = Lot_RegisterObject("NOTESSERVER", UNIN_CLASS_ICON$, programgroup$+"\"+LdString(SID_NOT_SERVER_TITLE))
  2656.                 END IF
  2657.             END IF
  2658.         END IF
  2659.  
  2660.     END IF
  2661.  
  2662. SKIPCONFIG:
  2663.  
  2664. END FUNCTION
  2665.  
  2666. '*************************************************************************
  2667. '** FUNCTION PostSuccessRegNOT (prodno%, network$, direction$) AS STRING
  2668. '**
  2669. '** Purpose: If you need to launch something after install runs
  2670. '** In Symbols : 
  2671. '** Out Symbols: 
  2672. '**            
  2673. '** Arguments:  All paremeters are **read only**. 
  2674. '**          prodno%: This is your prodno%.  It is assigned to you by the
  2675. '**                   toolkit in the order in which you were registered.
  2676. '**                   When your product is part of SmartSuite, SmartSuite
  2677. '**                   will always be product #1. (prodno% >=1)
  2678. '**         network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
  2679. '**       direction$: gNEXT 
  2680. '**
  2681. '** Errors:    No return code for errors, you must Raise them
  2682. '** Author:    MMeth
  2683. '** Returns:   return: gNEXT 
  2684. '**
  2685. '*************************************************************************
  2686.  
  2687. PUBLIC FUNCTION PostSuccessRegNOT (prodno%, network$, direction$) AS STRING
  2688. DIM dum%, tmp$, exepath$
  2689.  
  2690.     PostSuccessRegNOT = direction$
  2691.     '' In the backwards case, keep backing up
  2692.     If direction$ = gBACK Then
  2693.         EXIT FUNCTION
  2694.     End If
  2695.     '** Query the user if they would like to automaticlly launch Notes.
  2696.     IF ((GetSymbolValue(SYM_AUTOMATIONINST$) = gFALSE$)  AND (network$ <> gSERVER)) THEN
  2697.         dum% = DoMsgBox(LdString(SID_NOT_RUN_NOTES), LdString(SID_NOT_NOTES_NAME),MB_YESNO + MB_ICONQUESTION)
  2698.         IF dum% = IDYES THEN 
  2699.             '** If the user selected to Launch Notes then find out the Install type and generate the string
  2700.             '** to be passed to "inst.lss".
  2701.             IF gPartitioned% = 1 THEN
  2702.                 gNotesInstallType$ = Lot_TrimEndSlash(GetSymbolValue("NOTWORKDIR"))+"\"+"nclient.bat"
  2703.             ELSE
  2704.  
  2705.  
  2706.  
  2707.  
  2708.                 exepath$ = Lot_WhereIsFeature(prodno%, "NOTESPROGRAM", LdString(SID_NOT_NOTES))
  2709.                 gNotesInstallType$ = exepath$+LdString(SID_NOT_NOTES)
  2710.  
  2711.             END IF
  2712.         END IF
  2713.     END IF
  2714. END FUNCTION
  2715.  
  2716.  
  2717. '*************************************************************************
  2718. '** NOTMOREDIRSCB
  2719. '** Purpose:  This SUB handles the processing for the MORE DIRECTORIES    
  2720. '**           dialog.  
  2721. '**
  2722. '** IN SYMBOLS  handle to dialog, Control ID, Class, Instance
  2723. '**     
  2724. '** Author: Michael Natsis
  2725. '** Arguments:
  2726. '**     
  2727. '**     
  2728. '** Returns:
  2729. '**     
  2730. '*************************************************************************
  2731. SUB NOTMOREDIRSCB (hDlg&, CtrlId%, Classes$, LInst&)
  2732.    DIM dirChanged1%, dirChanged2%, dirChanged3%, i%, notused% 
  2733.    DIM drvSel%,Inst%, dirToChange1$, dirToChange2$,dirToChange3$
  2734.    STATIC drvIndex%(1 to MAX_NO_DRIVECOMBOS)
  2735.  
  2736.    '** unc start
  2737.    DIM    uncPath$, fullPath$, dirPath$, drvPath$, n%, hCombo&  '** MZ
  2738.    DIM    curCombo$, uncOff&, unusedPath$, NumDirs%
  2739.    DIM    comboBox$, editBox$,dirToChange$ 
  2740.    '** unc end
  2741.  
  2742.    Inst% = CINT(LInst&)
  2743.  
  2744. '** unc start
  2745. '** Handle all the combo boxes here (if any)
  2746.    IF INSTR(Classes$, "IDC_COMBO") THEN
  2747.       i% = VAL(MID$(Classes$, 10, LEN(Classes$) - 9))
  2748.       comboBox = "IDC_COMBO"+Right$(Str$(i%),1)
  2749.       editBox = "IDC_EDIT"+Right$(Str$(i%),1)
  2750.       drvIndex%(i%) = Inst%
  2751.       curCombo$ = GetListItem(comboBox, Inst%)
  2752.       fullPath$ = GetListItem("IDC_EDIT",i)
  2753.       Lot_SplitUNCPath fullPath$, uncPath$, dirPath$
  2754.       uncOff& = INSTR(1, curCombo$, "\\") 
  2755.       IF uncOff > 0 THEN
  2756.     Lot_SplitUNCPath MID$(curCombo$, uncOff&), uncPath$, unusedPath$
  2757.       ELSE
  2758.     uncPath$ = ""
  2759.       END IF
  2760.       SetListItem "IDC_EDIT", i, uncPath$ + dirPath$
  2761.       AddListItem SYM_UPDATELIST$, editBox
  2762.       EXIT SUB
  2763.    END IF
  2764. '** unc end
  2765.  
  2766.  
  2767.  
  2768.    SELECT CASE Classes$
  2769.     
  2770.       CASE "__DLGINIT"
  2771.  
  2772.     '** This is the directory for the Work Files
  2773.         Lot_GetDriveFreeSpaceList "IDC_COMBO1"
  2774.         SetListItem "IDC_EDIT", 1, GetSymbolValue("NOTWORKDIR")
  2775.         drvIndex%(1) = ValidateEditBox(hDlg& , 1)
  2776.         AddListItem SYM_UPDATELIST$, "IDC_EDIT1"
  2777.  
  2778.              
  2779.      '** This is the directory for the Smart Master Files
  2780.         Lot_GetDriveFreeSpaceList "IDC_COMBO2"
  2781.         SetListItem "IDC_EDIT", 2, GetSymbolValue("NOTMASTERSDIR")
  2782.         drvIndex%(1) = ValidateEditBox(hDlg& , 2)
  2783.         AddListItem SYM_UPDATELIST$, "IDC_EDIT2"
  2784.  
  2785.      '** This is the directory for the Backup Files
  2786.         Lot_GetDriveFreeSpaceList "IDC_COMBO3"
  2787.         SetListItem "IDC_EDIT", 3, GetSymbolValue("NOTBACKUPDIR")
  2788.         drvIndex%(1) = ValidateEditBox(hDlg& , 3)
  2789.         AddListItem SYM_UPDATELIST$, "IDC_EDIT3"
  2790.  
  2791.       CASE "IDC_COMBO"
  2792.         SELECT CASE Inst%
  2793.             CASE 1
  2794.                  dirChanged1% = TRUE
  2795.  
  2796.       CASE 2
  2797.                  dirChanged2% = TRUE
  2798.  
  2799.       CASE 3 
  2800.            dirChanged3% = TRUE
  2801.  
  2802.         END SELECT
  2803.  
  2804.      CASE "IDC_BRWSDIR"
  2805.            drvSel% = ValidateBrowse(hDlg&,Inst%)
  2806.            SELECT CASE Inst%      
  2807.       
  2808.           CASE 1    
  2809.            dirChanged1% = TRUE
  2810.               
  2811.           CASE 2    
  2812.            dirChanged2% = TRUE
  2813.            
  2814.     CASE 3    
  2815.            dirChanged3% = TRUE
  2816.       
  2817.           END SELECT       
  2818.  
  2819.      CASE "IDC_EDIT"
  2820.      SELECT CASE Inst%
  2821.        CASE 1    
  2822.          dirChanged1% = TRUE            
  2823.                 
  2824.         CASE 2
  2825.          dirChanged2% = TRUE    
  2826.  
  2827.            CASE 3
  2828.              dirChanged3% = TRUE
  2829.             
  2830.      END SELECT
  2831.  
  2832.      CASE "IDC_OK"
  2833.          '** Validate Paths always: to check for a file with the same name
  2834.  
  2835.         '** WorkDir 
  2836.         '** unc start 1
  2837.             drvSel% = ValidateEditBox(hDlg& , 1)
  2838.             IF drvSel% = 0 THEN
  2839.                 SetListItem "__LASTSTATUS", 1, "Q"
  2840.                 EXIT SUB
  2841.             ELSE 
  2842.                 drvIndex%(1) = drvSel%
  2843.             END IF
  2844.             Lot_SplitUNCPath GetListItem("IDC_EDIT",1), uncPath$, dirPath$
  2845.             IF uncPath$ = "" THEN
  2846.                 drvPath = LEFT$(GetListItem("IDC_COMBO1",drvIndex%(1)), 2)
  2847.             ELSE
  2848.                 drvPath = ""
  2849.             END IF
  2850.             dirToChange1$ = drvPath$ + uncPath + dirPath$
  2851.         '** unc end
  2852.  
  2853.         IF ValidatePath(dirToChange1$) = FALSE THEN
  2854.         SetListItem "_LASTSTATUS",1,"Q"
  2855.         EXIT SUB
  2856.  
  2857.         ELSE
  2858.              SetSymbolValue "NOTWORKDIR", dirToChange1$
  2859.   
  2860.         END IF
  2861.  
  2862.  
  2863.         '** SMasters
  2864.         '** unc start 2
  2865.             drvSel% = ValidateEditBox(hDlg& , 2)
  2866.             IF drvSel% = 0 THEN
  2867.                SetListItem "__LASTSTATUS", 1, "Q"
  2868.                EXIT SUB
  2869.             ELSE 
  2870.                drvIndex%(2) = drvSel%
  2871.             END IF
  2872.             Lot_SplitUNCPath GetListItem("IDC_EDIT",2), uncPath$, dirPath$
  2873.             IF uncPath$ = "" THEN
  2874.                drvPath = LEFT$(GetListItem("IDC_COMBO2",drvIndex%(2)), 2)
  2875.             ELSE
  2876.                drvPath = ""
  2877.             END IF
  2878.             dirToChange2$ = drvPath$ + uncPath + dirPath$
  2879.         '** unc end
  2880.            IF ValidatePath(dirToChange2$) = FALSE THEN
  2881.         SetListItem "_LASTSTATUS",1,"Q"
  2882.         ELSE 
  2883.              SetSymbolValue "NOTMASTERSDIR", dirToChange2$
  2884.             END IF
  2885.  
  2886.  
  2887.         '** Backup
  2888.         '** unc start 3
  2889.             drvSel% = ValidateEditBox(hDlg& , 3)
  2890.            IF drvSel% = 0 THEN
  2891.               SetListItem "__LASTSTATUS", 1, "Q"
  2892.               EXIT SUB
  2893.            ELSE 
  2894.               drvIndex%(3) = drvSel%
  2895.            END IF
  2896.               Lot_SplitUNCPath GetListItem("IDC_EDIT",3), uncPath$, dirPath$
  2897.            IF uncPath$ = "" THEN
  2898.               drvPath = LEFT$(GetListItem("IDC_COMBO3",drvIndex%(3)), 2)
  2899.            ELSE
  2900.               drvPath = ""
  2901.            END IF
  2902.            dirToChange3$ = drvPath$ + uncPath + dirPath$
  2903.           IF ValidatePath(dirToChange3$) = FALSE THEN
  2904.         SetListItem "_LASTSTATUS",1,"Q"
  2905.  
  2906.            ELSE 
  2907.              SetSymbolValue "NOTBACKUPDIR", dirToChange3$
  2908.            END IF 
  2909.    
  2910.  
  2911.      '** Refresh destination
  2912.      'Lot_RefreshDestination("NOTWORKDIR")
  2913.      'Lot_RefreshDestination("NOTMASTERSDIR")
  2914.      'Lot_RefreshDestination("NOTBACKUPDIR")
  2915.  
  2916. END SELECT   'Classes
  2917.  
  2918. END SUB
  2919.  
  2920. '********************************
  2921. '********************************
  2922. '** Product Specific Functions **
  2923. '********************************
  2924. '********************************
  2925.  
  2926. '*************************************************************************
  2927. '** FUNCTION DetectPreviousVersion () AS STRING
  2928. '**            
  2929. '** Purpose:   Find a previous version of Notes
  2930. '** Author:    Fareed Assarpour
  2931. '** Arguments: None
  2932. '** Returns:   What product we found
  2933. '*************************************************************************
  2934.  
  2935. FUNCTION DetectPreviousVersion () AS STRING
  2936.  
  2937.     DetectPreviousVersion = ""
  2938.  
  2939. END FUNCTION
  2940.  
  2941.  
  2942. '*************************************************************************
  2943. '** SUB WriteWinIni(prodno%)
  2944. '**
  2945. '** Purpose:   Writes configuration entries in Win.ini
  2946. '** Author:    FA
  2947. '** Arguments: None
  2948. '** Returns:   SUCCESS
  2949. '*************************************************************************
  2950.  
  2951. SUB WriteWinIni(prodno%)
  2952. Dim DestDir$, ProdDir$, WKDir$, dum%
  2953.  
  2954.     DestDir$ = GetWindowsDir() + gWININI$
  2955.     '** This is the top level directory where the Notes.exe lives
  2956.     ProdDir$  = Lot_GetTheRealProdDir(prodno%)
  2957. '    dum% = DoMsgBox("Lot_GetTheRealProdDir() returned: "+ProdDir$, "WriteWinIni", MB_OK)
  2958.  
  2959.     WKDir$ = ProdDir$ + "NOTES.EXE"
  2960.     CreateIniKeyValue DestDir$, "Extensions", "nsf", WKDir$+" ^.nsf", cmoOverwrite
  2961.     CreateIniKeyValue DestDir$, "Extensions", "ns3", WKDir$+" ^.ns3", cmoOverwrite
  2962.     CreateIniKeyValue DestDir$, "Extensions", "nsg", WKDir$+" ^.nsg", cmoOverwrite
  2963.     CreateIniKeyValue DestDir$, "Extensions", "nsh", WKDir$+" ^.nsh", cmoOverwrite
  2964.     CreateIniKeyValue DestDir$, "Extensions", "ns2", WKDir$+" ^.ns2", cmoOverwrite
  2965.     CreateIniKeyValue DestDir$, "Extensions", "ntf", WKDir$+" ^.ntf", cmoOverwrite
  2966. '    CreateIniKeyValue DestDir$, "MAIL", "CMCDLLNAME", ProdDir$+"cmc.dll", cmoOverwrite
  2967.     CreateIniKeyValue DestDir$, "Mail", "SMI", "1", cmoOverwrite
  2968.     CreateIniKeyValue DestDir$, "LotusMail", "Application", "Notes", cmoOverwrite
  2969.     CreateIniKeyValue DestDir$, "LotusMail", "Program", ProdDir$+"Notes.exe NoDialogs", cmoOverwrite
  2970.  
  2971. END SUB
  2972.  
  2973. '*************************************************************************
  2974. '** SUB WriteNOTIni(network$) 
  2975. '**
  2976. '** Purpose:   Write the configuration entries in notes.ini
  2977. '** Author:    FA
  2978. '** Arguments: None
  2979. '** Returns:   SUCCESS
  2980. '*************************************************************************
  2981.  
  2982. SUB WriteNOTIni(network$, prodno%)
  2983. Dim DestDir$, dum%, ProgramChapter$, DataDir$, BootDrive$
  2984.  
  2985.     ON Error RESUME NEXT
  2986.     BootDrive$ = Lot_TrimEndSlash(GetBootDrive())
  2987.     MKDIR BootDrive$+"\temp"
  2988.  
  2989.     '** If this is a virtual server install then the NOTES.INI file
  2990.     '** resides in the Notes data directory and not in the windows
  2991.     '** directory, So set the notes.ini dir (DestDir) to point to the data dir.
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.     IF gPartitioned% = 1 THEN
  3007.         '** Set the notes.ini dir to the Data directory.
  3008.         if gDebugPartition = 1 THEN PRINT "Partitions on so install (notes.ini) in data dir :"+DestDir$
  3009.         DestDir$ = GetSymbolValue("NOTWORKDIR")+"\"+"notes.ini"
  3010.         if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "Install thinks Partitioned Server selected so Kittype = 2"
  3011.         gKitType$="2"
  3012.         CreateIniKeyValue DestDir$, LdString(SID_NOT_REG_NOTES_NAME), "NOTESPROGRAM", gNotesPartitionedProg$, cmoOverwrite
  3013.     ELSE
  3014.         '** Set the notes.ini dir to the Windows directory.
  3015.         IF gDebugNotesIni = 1 THEN Print "Notes ini dir "+gNotesIni$
  3016.         DestDir$ = GetWindowsDir() + "notes.ini"
  3017.         IF gNotesIni$ <> "" THEN
  3018.             IF gNotesIni$ <> DestDir$ THEN
  3019.                 DestDir$ = gNotesIni$
  3020.             END IF
  3021.         END IF
  3022.         '** Is the Notes Server chapter installed
  3023.         IF Lot_IsTheFeatureInstalled("NOTESSERVER") <> FALSE Then
  3024.             ProgramChapter$ = Lot_GetChapterFromKeyWord("NOTESSERVER")
  3025.             '** Is the Notes Server chapter selected ?
  3026.             IF Lot_GetChapterValInt(ProgramChapter$, F_INOROUT) THEN
  3027.                 if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "Install thinks Server selected so Kittype = 2"
  3028.                 gKitType$="2"
  3029.             END IF
  3030.         ELSE
  3031.             gKitType$ = "1"        '' Laptop default to Client
  3032.             if gDebugKittype = 1 OR gDebugNotes = 1 THEN PRINT "Install thinks Workstation selected so Kittype = 1"
  3033.         END IF
  3034.     END IF
  3035.  
  3036.     '** Get the notes data directory
  3037.     datadir$ = GetSymbolValue("NOTWORKDIR")
  3038.     CreateIniKeyValue DestDir$, "Notes", "KitType", gKitType, cmoOverwrite
  3039.     CreateIniKeyValue DestDir$, "Notes", "Directory", datadir$, cmoOverwrite
  3040.     CreateIniKeyValue DestDir$, "Notes", "SETUPDB", "SETUP.NSF", cmoOverwrite
  3041.     CreateIniKeyValue DestDir$, "Notes", "USERNAME", GetSymbolValue(SYM_NAME), cmoOverwrite
  3042.     CreateIniKeyValue DestDir$, "Notes", "COMPANYNAME", GetSymbolValue(SYM_COMPANY), cmoOverwrite
  3043.     CreateIniKeyValue DestDir$, "Notes", "MTATEMP", BootDrive$+"\TEMP", cmoOverwrite
  3044.     CreateIniKeyValue DestDir$, "Notes", "NOTESPROGRAM", GetSymbolValue("NOTDIR"), cmoOverwrite
  3045.     IF GetIniKeyString(DestDir$,"NOTES","LITEKIT") <> "" THEN
  3046.         RemoveIniKey DestDir$,"Notes", "LITEKIT", cmoOverwrite
  3047.     END IF
  3048.  
  3049.  
  3050.  
  3051.     IF GetIniKeyString(DestDir$,"NOTES","RemoteServer") <> "" THEN
  3052.         RemoveIniKey DestDir$,"Notes", "RemoteServer", cmoOverwrite
  3053.     END IF
  3054.     IF GetIniKeyString(DestDir$,"NOTES","Windows_Title") <> "" THEN
  3055.         RemoveIniKey DestDir$,"Notes", "Windows_Title", cmoOverwrite
  3056.     END IF
  3057.     IF gPartitioned% = 1 THEN
  3058.         if gDebugPartition = 1 THEN PRINT "Partitions on so ADD special values."
  3059.         CreateIniKeyValue DestDir$, "Notes", "NPN", "1", cmoOverwrite
  3060.     END IF
  3061.  
  3062. END SUB
  3063.  
  3064. '*************************************************************************
  3065. '** SUB WriteOLERegForNOT(network$, prodno%)
  3066. '**
  3067. '** Purpose:    This function writes OLE registration needed
  3068. '** Author:     FA
  3069. '** Arguments:  
  3070. '** Returns:    SUCCESS
  3071. '*************************************************************************
  3072.  
  3073. SUB WriteOLERegForNOT(network$, prodno%)
  3074. DIM ShellCommand$, ShellResult%
  3075.  
  3076.     ShellCommand = GetWindowsDir() + "regedit.exe /s " + GetWindowsSysDir()+ "ole2.reg"
  3077.     'print "shell command is: "+ ShellCommand
  3078.     ShellResult = SHELL(ShellCommand,0)
  3079.  
  3080. END SUB
  3081.  
  3082.  
  3083. '*************************************************************************
  3084. '** SUB WriteNOTInLotusIni(prodno%)
  3085. '**
  3086. '** Purpose:    This function logs Notes product in lotus.ini
  3087. '** Author:     FA
  3088. '** Arguments:  
  3089. '** Returns:    SUCCESS
  3090. '*************************************************************************
  3091.  
  3092. SUB WriteNOTInLotusIni(prodno%)
  3093. Dim DestDir$, Program$, dum%
  3094.  
  3095.     DestDir$ = GetWindowsDir() + "lotus.ini"
  3096.     Program$  = Lot_GetTheRealProdDir(prodno%)+"notes.exe"
  3097.     CreateIniKeyValue DestDir$, "Lotus Applications", "Notes",  Program$,   cmoOverwrite
  3098.  
  3099. END SUB
  3100.  
  3101. '*************************************************************************
  3102. '** SUB WriteProgMan(network$, prodno%, title$)
  3103. '**
  3104. '** Purpose:  Create Program Items in the program mamager
  3105. '** Author:   FA
  3106. '** Arguments:None
  3107. '** Returns:  SUCCESS
  3108. '*************************************************************************
  3109.  
  3110. 'SUB WriteProgMan(network$, prodno%, title$)
  3111. '
  3112. '
  3113. '    IF Lot_IsTheFeatureInstalled("NOTA") <> FALSE Then
  3114. '        gProdDir$ = Lot_WhereIsFeature(prodno%, "NOTTOP", "notes.exe")
  3115. '        Program$ = ProgDir + "notes.exe"
  3116. '        CreateProgmanItem  title$, "Notes 4.0", Program, "", cmoOverwrite
  3117. '    END IF
  3118. '
  3119. '    IF Lot_IsTheFeatureInstalled("NOTK") <> FALSE Then
  3120. '        gProdDir$ = Lot_WhereIsFeature(prodno%, "NOTK", "notetour.exe")
  3121. '        
  3122. '        Program$ = GetSymbolValue("NOTDIR") + "notetour\notetour.exe"
  3123. '        CreateProgmanItem  title$, "Lotus Guided Tour", Program, "", cmoOverwrite
  3124. '    END IF
  3125. '
  3126. '
  3127. 'END SUB
  3128.  
  3129. '** SUB REMOVEOLDFILESCB (hDlg&, CtrlId%, Classes$, Inst%)
  3130. '**
  3131. '** Purpose: Fill in the list box with as set of files found, and allow 
  3132. '**          the use to select the files they wish removed.
  3133. '**
  3134. '** Note:    The Inst% var passed to this routien is a One(1) base array
  3135. '**            and the var returnd from Windows is Zero(0) based.
  3136. '**            
  3137. '** Author:    Michael Clark
  3138. '** Arguments: Callback args
  3139. '** Returns:   NONE
  3140. '*************************************************************************
  3141.  
  3142. SUB REMOVEOLDFILESCB (hDlg&, CtrlId%, Classes$, Inst&)
  3143.  
  3144.    DIM ProgManIni$, Group$, GroupId%,count%, Index%,notused%,DefaultGroup$
  3145.    DIM GroupPath$,GroupName$, SelectedName$, EnteredName$,order%, failed%
  3146.     DIM dum%, x%, MyStr$, chapter$, ProdNumber%, Product_Name$, child$
  3147.     DIM section$, filename$, lastfilename$, found%, tmpname$, destdir$
  3148.     DIM description$, listcount%, Deletefiles%
  3149.     DIM Buffer$
  3150.    
  3151.     Buffer$ = string(256,0)
  3152.  
  3153.  
  3154.    SELECT CASE Classes$
  3155.  
  3156.    CASE "__DLGINIT"
  3157.     '    set up dlgbox
  3158.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT1)
  3159.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT2)
  3160.         AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
  3161.         SetListItem "IDC_TEXT",2, gDeleteDialogText$
  3162.         AddListItem SYM_UPDATELIST$, "IDC_TEXT2"
  3163.  
  3164.  
  3165.    CASE "IDC_LIST1"
  3166.  
  3167.    CASE "IDC_B"
  3168.         ''** Get the number of items that were added to the list.
  3169.         ''** Number of files found. And select each file in the list.
  3170.         listcount% = SendDlgItemMessage(hDlg&,IDC_LIST1,LB_GETCOUNT,0,0)
  3171.         'print str$(listcount%)+" Files were found in the list"
  3172.         FOR DeleteFiles = 0 to listcount% - 1
  3173.             dum% = SendDlgItemMessage(hdlg&,IDC_LIST1,LB_SETSEL,1,DeleteFiles%)
  3174.             IF dum% = -1 THEN
  3175.                 'print "File index is:"+str$(DeleteFiles)
  3176.             END IF
  3177. '            Print "LB_SETSEL returned :"+str$(dum%)
  3178.         NEXT
  3179.  
  3180.    CASE "IDC_OK"
  3181.         
  3182.         listcount% = SendDlgItemMessage(hdlg&,IDC_LIST1,LB_GETCOUNT,0,0)
  3183.         IF listcount% <> 0 Then
  3184.             'print " We have "+str$(listcount%)+" Items in the list"
  3185.             FOR count% = 0 TO listcount% -1
  3186.                 IF SendDlgItemMessage(hdlg&, IDC_LIST1, LB_GETSEL, count%,0) <> 0 Then 
  3187.                     dum% = SendDlgItemMessageLb(hdlg&,IDC_LIST1,LB_GETTEXT,count%,Buffer$)
  3188.                     IF dum% <> LB_ERR Then
  3189.                         'print "File :"+Buffer$+" Will be deleted!"
  3190.                         RemoveFile Buffer$, cmoNone
  3191.                     else
  3192.                         'print "ERROR item "+str$(count%)+"  ERROR#:"+str$(dum%)+" File :"+Buffer$+"!"
  3193.                     END IF
  3194.                 END IF
  3195.             NEXT
  3196.         'print "Finished removing files"
  3197.         END IF
  3198.     ''Print "Finished doing delete of files"
  3199.  
  3200.    CASE "IDC_BACK"
  3201.  
  3202.    CASE "IDC_HELP"
  3203.    CASE "IDC_EXIT"
  3204.    END SELECT   
  3205. END SUB
  3206.  
  3207. FUNCTION DoesFileExistInDir (dirlist$) AS INTEGER
  3208. '** Purpose:   Takes a list of directories and puts up an error message
  3209. '**            listing all the directories which have files in them. 
  3210. '** In Symbols: 
  3211. '** OUT symbols: 
  3212. '**             
  3213. '**     
  3214. '** Author:  JYOTI KEDIA
  3215. '** Arguments: list of directories
  3216. '**     
  3217. '**     
  3218. '** Returns: TRUE
  3219. '**     
  3220. '*************************************************************************
  3221.    DIM errstr$, n%, i%, dirname$, RC%, temp$, sz$
  3222.  
  3223.    DoesFileExistInDir = TRUE
  3224.    errstr$ = ""
  3225.    n% = GetListLength(dirlist$)
  3226.    for i% = 1 to n%
  3227.       dirname$ = GetListItem(dirlist$,i%) 
  3228.       rc% = DoesDirExist(dirname$)
  3229.       If DoesDirExist(dirname$)Then                
  3230.      temp$ = Lot_Dir(dirname$+"\*.*") 
  3231.      if temp$ <> "" Then 
  3232.         errstr$ = errstr$ + CHR$(10) + CHR$(10) + "     " + dirname$
  3233.      end if
  3234.       end if
  3235.    Next
  3236.        
  3237.    if errstr$ <> "" Then
  3238.       sz$ = LdString(SID_DIR_NOT_EMPTY) + errstr$
  3239.       RC% = DoMsgBox(sz$,LdString(SID_TKT_STD_TITLE),MB_OKCANCEL + MB_ICONEXCLAMATION) 
  3240.       if RC% <> 1 Then
  3241.      SetListItem "__LASTSTATUS",1,"Q"
  3242.      EXIT FUNCTION
  3243.       end if 
  3244.    end if
  3245.  
  3246. END FUNCTION
  3247. '*************************************************************************
  3248. '** FUNCTION GetNotesFromPath(network$)
  3249. '** Purpose:   Search for Notes on the users System.
  3250. '**            1.) For V4 we can find the Notes program directory in the registry
  3251. '**                    by looking for HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\4.0 and
  3252. '**                    retrieve the PATH entry.
  3253. '**            2.) Search for a prior version of the notes ?strings.dll on the path
  3254. '**            3.) Search for lotus.ini and see if Notes is located in it.
  3255. '**            4.) Search the registry for Notes.
  3256. '**                    For V3 search for the following registry key:
  3257. '**                    "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
  3258. '**                    If this key is found then search all the paths associated
  3259. '**                    with this key for "Notes.ini".
  3260. '**            5.) Search for notes.ini on the Path and/or in the windows\system dir or in Lotus.ini
  3261. '**
  3262. '** OUT symbols:
  3263. '**                        gKitType$    =    1=Client, 2=Server.
  3264. '**                     gNotesProg$    = Prior location of Notes executables.
  3265. '**                     gNotesData$    = Prior location of Notes data files.
  3266. '**             
  3267. '**     
  3268. '** Author:  Michael Clark
  3269. '** Arguments:
  3270. '**     
  3271. '**     
  3272. '*************************************************************************
  3273. FUNCTION GetNotesFromPath(network$)
  3274.     DIM NotesPath$        '** Location of Notes as returned from registry.
  3275.     DIM NotesFromPath$            '** Notes Program returned from Path Search for Notes.
  3276.     DIM NotesFromReg$            '** Notes Program from Registry Search for Notes.
  3277.     DIM NotesFromLotus$            '** Notes Program from Lotus.ini Search for Notes.
  3278.     DIM NotesIniFromWinDir$        '** Notes.ini returned from Windows directory Search for Notes.
  3279.     DIM NotesIniFromSessionMgr$    '** Notes.ini returned from V3 registry entry Search for Notes.
  3280.     DIM NotesIniFromPath$        '** Notes.ini returned from V3 registry entry Search for Notes.
  3281.     DIM NotesProgDirFromPartitioned$        '** Notes Program directory returned from Partitioned search.
  3282.     DIM NotesDataDirFromPartitioned$        '** Notes Data directoryreturned from Partitioned search.
  3283.  
  3284.     NotesFromReg$ = String(256,0)
  3285.  
  3286. ''    ON ERROR RESUME NEXT
  3287.  
  3288.     IF IsNotesInRegistry(NotesFromReg$) = TRUE THEN
  3289.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes Program directory Via Registry :"+NotesFromReg$
  3290.     ELSE
  3291.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes not found in registry"
  3292.     END IF
  3293.  
  3294.     IF IsNotesOnPath(NotesFromPath$) = TRUE THEN
  3295.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes Program directory Via Path :"+NotesFromPath$
  3296.     ELSE
  3297.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes not found on path"
  3298.     END IF
  3299.  
  3300.     IF IsNotesInLotusIni(NotesFromLotus$) = TRUE THEN
  3301.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes Program directory Via Path :"+NotesFromLotus$
  3302.     ELSE
  3303.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes not found in Lotus.ini"
  3304.     END IF
  3305.  
  3306.  
  3307.     IF IsNotesInSessMgr(NotesIniFromSessionMgr$) = TRUE THEN
  3308.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes.ini using session manager setting in registry :"+NotesIniFromSessionMgr$
  3309.     ELSE
  3310.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes.ini not found in Session Manager setting."
  3311.     END IF
  3312.  
  3313.  
  3314.     IF IsNotesIniOnPath(NotesIniFromPath$) = TRUE THEN
  3315.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes.ini using PATH :"+NotesIniFromPath$
  3316.     ELSE
  3317.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes.ini not found in PATH."
  3318.     END IF
  3319.  
  3320.     IF IsNotesIniInWinDir(NotesIniFromWinDir$) = TRUE THEN
  3321.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Notes.ini in Windows directory :"+NotesIniFromWinDir$
  3322.     ELSE
  3323.         IF gDebugNotesFromPath = 1 THEN PRINT "Notes.ini not found Windows directory."
  3324.     END IF
  3325.  
  3326.  
  3327. '** Now Find out if the is a Partitioned Server Install.
  3328. '**
  3329. '**
  3330.     IF IsPartitonedInstall(NotesProgDirFromPartitioned$, NotesDataDirFromPartitioned$) = TRUE THEN
  3331.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Partitioned Program Dir :"+NotesProgDirFromPartitioned$
  3332.         IF gDebugNotesFromPath = 1 THEN PRINT "Found Partitioned Data Dir :"+NotesDataDirFromPartitioned$
  3333.         gPartitionsInstalled% = 1
  3334.         gPartitioned% = 1
  3335.     ELSE
  3336.         IF gDebugNotesFromPath = 1 THEN PRINT "Partitions are not installed. (YET)."
  3337.         gPartitioned% = 0
  3338.         gPartitionsInstalled% = 0
  3339.     END IF
  3340.  
  3341.     '** if the Registry and the path agree to the location of the Notes program dir then
  3342.     '** set gNotesProg to This value. If it doesn't then set gNotesProg to the directory
  3343.     '** found using the path search.
  3344.  
  3345.     '** Figure out what to do with the information we just gathered
  3346.  
  3347.     IF NotesFromPath <> "" THEN
  3348.         IF NotesFromReg$ = NotesFromPath$ THEN
  3349.             gNotesProg$ = NotesFromReg$
  3350.         ELSE
  3351.             gNotesProg$ = NotesFromPath$        '** NOTE the path ALWAYS wins.
  3352.         END IF
  3353.     ELSEIF NotesFromReg$ <> "" THEN
  3354.         gNotesProg$ = NotesFromReg$
  3355.     ELSEIF NotesFromLotus$ <> "" THEN
  3356.         gNotesProg$ = NotesFromLotus$
  3357.     ELSE
  3358.         gNotesProg$ = ""
  3359.     END IF
  3360.  
  3361.     IF NotesIniFromSessionMgr$ = NotesIniFromPath$ THEN
  3362.         gNotesIni$ = NotesIniFromSessionMgr$
  3363.     ELSE
  3364.         gNotesIni$ = NotesIniFromPath$        '** NOTE the path ALWAYS wins.
  3365.     END IF
  3366.  
  3367.     IF NotesIniFromPath$ <> "" THEN
  3368.         IF ValidateIni(NotesIniFromPath$) = TRUE THEN
  3369.             gNotesIni$ = NotesIniFromPath
  3370.         ELSE
  3371.             gNotesIni$ = ""
  3372.         END IF 
  3373.     END IF 
  3374.  
  3375.     '** if this is a node install then the program directory is the same as
  3376.     '** the data directory.
  3377.     IF network$ = gNODE$ THEN gNotesProg$ = gNotesData$
  3378.     SetSymbolValue SYM_BASEDIR$, gNotesProg$
  3379.     IF gNotesProg$ <> ""  OR gNotesData$ <> "" Then
  3380.         gPreviousNotesInstalled% = 1
  3381.     END IF
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388. '** While we are here lets also find out the Type of install (e.g KitType) and
  3389. '** the NotesData Directory.
  3390.     IF gNotesIni$ <> "" THEN
  3391.         IF gDebugNotesFromPath = 1 THEN PRINT "gNotesIni Found in OS system path "+gNotesIni$
  3392.         gKitType$ = LCASE$(GetIniKeyString(gNotesIni$,"NOTES","KitType"))
  3393.         IF gDebugNotesFromPath = 1 THEN PRINT "gKitType Found in OS system path "+gKitType
  3394.         gNotesData$ = LCASE$(GetIniKeyString(gNotesIni$,"NOTES","Directory"))
  3395.         IF gDebugNotesFromPath = 1 THEN PRINT "gNotesData Found in OS system path "+gNotesData$
  3396.     END IF
  3397.  
  3398.     '** If this is a partitioned server then ALWAYS do this.
  3399.     IF (gPartitioned% = 1) THEN
  3400.         gNotesProg$ = NotesDataDirFromPartitioned$
  3401.         gNotesData$ = NotesDataDirFromPartitioned$
  3402.         gNotesPartitionedProg$ = NotesProgDirFromPartitioned$
  3403.     END IF
  3404.  
  3405. END FUNCTION
  3406.  
  3407. FUNCTION GetObsoleteFiles(direction$) AS STRING
  3408. '** Purpose:   Read through all the file sections listed in the file
  3409. '**                "obsolete.nam"    if the file exists add it to the list 
  3410. '**                of files to be deleted or if the section being read is 
  3411. '**                part of the auto delete section then delete each file
  3412. '**                as we check for it's existance. If the section was not
  3413. '**                part of the auto delete section then after processing
  3414. '**                the whole section display a list box with all the files
  3415. '**                found    and allow the user the choice of deleteing the 
  3416. '**                files listed.
  3417. '**             
  3418. '** OUT symbols:    Direction$
  3419. '**     
  3420. '** Author:  Michael Clark
  3421. '**     
  3422. '**     
  3423. '*************************************************************************
  3424. DIM Obsolete$        '** File name of obsolete file list.
  3425. DIM FileNumber%    '** File Handle.
  3426. DIM Buffer$            '** Line Buffer.
  3427. DIM Title$            '** Title of group being processed.
  3428. DIM FileName$        '** Name of file to be deleted.
  3429. DIM ItemsInGroup%    '** Number of items in the current group.
  3430. DIM LineType%        '** Type of line being processed (See GetLine Function)
  3431. DIM ChapterName$    '** Chapter number that the file belongs to.
  3432. DIM DisplayGroup%    '** 1 = Do Display group, 0 = Don't display group
  3433. DIM RCDialog$        '** Return from Dialog (indicates direction)
  3434.  
  3435. DIM InGroup%, LineLength%
  3436. DIM tmp$, notused%
  3437. DIM FoundStr%, FoundStr1%, Found%
  3438.  
  3439.     '** Default selection of "go to next" .
  3440.     GetObsoleteFiles = gNEXT
  3441.  
  3442.    GetObsoleteFiles = direction$
  3443.    '** In the backwards case, keep backing up
  3444.    If direction$ = gBACK Then
  3445.       EXIT FUNCTION
  3446.    END IF
  3447.  
  3448.     InGroup% = 0            '** 0 - Not in group of files to be deleted (DEFAULT)
  3449.                                 '** 1 - in group of files to be deleted
  3450.     ItemsInGroup% = 1        '** Number of items in group
  3451.     LineType%=0                '** Current switch selector
  3452.     DisplayGroup% = 0        '** Default to Don't display group.
  3453.  
  3454.     '** Get the location of the obsolete files list
  3455.     Obsolete$ = MakePath (GetSymbolValue(SYM_STF_CWDDIR$), OBSFILE$)
  3456.  
  3457.     AddListItem SYM_UPDATELIST$, "IDC_LIST1"
  3458.  
  3459.     '** Allocate a file handle
  3460.     FileNumber = FREEFILE()
  3461.     OPEN Obsolete$ FOR INPUT as FileNumber%
  3462.  
  3463.     DO
  3464.         '** Read a line of text, and get the type of line we are processing.
  3465.         '** SEE GetLine for types of lines processed.
  3466.         LineType% = GetLine(FileNumber%,Buffer$)
  3467.  
  3468.         SELECT CASE LineType%
  3469.             CASE 1    '** End of file found.
  3470.                 IF gDebugGetObs% = 1 THEN PRINT "Processing LineType"
  3471.                 '** Find out if we were in a group and if we were the process the files
  3472.                 '** otherwise do nothing.
  3473.                 IF InGroup = 1    THEN
  3474.                     '** If the group has files in it's list and we are supposed to display
  3475.                     '** the files then do so here.
  3476.                     IF ItemsInGroup > 1  AND DisplayGroup = 1 THEN
  3477.                         '** Register the callback and bring up the dialog.
  3478.                         notused% = RegisterCallback("NOT", "REMOVEOLDFILESCB")
  3479.                           RCDialog$ = PopupModalDlg(DBM_DELETELISTBOX, DBM_DELETELISTBOX)
  3480.                         IF RCDialog$ = gBACK Then
  3481.                             GetObsoleteFiles = gBACK
  3482.                             Close(FileNumber%)
  3483.                             EXIT FUNCTION        '** User elected to go back to last dialog.
  3484.                         END IF
  3485.                     '** I think here we should be deleteing the files, but I'll come back to this later.
  3486.                     END IF
  3487.                 '** Reset to not display group
  3488.                 DisplayGroup = 0
  3489.                 END IF
  3490.  
  3491.             CASE 2    '** Comment or whitespace
  3492.             if gDebugGetObs% = 1 THEN PRINT "Processing Comment"
  3493.                 ''** Don't do anything just skip the line.
  3494.  
  3495.             CASE 3    '** Start of a new section.
  3496.                 IF InGroup = 1    THEN '** This is a new group so display the old stuff.
  3497.                     if gDebugGetObs% = 1 THEN PRINT "Processing a new section"
  3498.  
  3499.                     '** If we are comming from an old group to a new group then
  3500.                     '** be sure to process the last group.
  3501.                     IF ItemsInGroup > 1 AND DisplayGroup = 1 THEN
  3502.                         if gDebugGetObs% = 1 THEN PRINT "Processing a new section, so cleaning up the last section."
  3503.                         '** Register the callback and bring up the dialog.
  3504.                         notused% = RegisterCallback("NOT", "REMOVEOLDFILESCB")
  3505.                           RCDialog$ = PopupModalDlg(DBM_DELETELISTBOX, DBM_DELETELISTBOX)
  3506.                         IF RCDialog$ = gBACK Then
  3507.                             GetObsoleteFiles = gBACK
  3508.                             Close(FileNumber%)
  3509.                             EXIT FUNCTION        '** User elected to go back to last dialog.
  3510.                         END IF
  3511.                     '** I think here we should be deleteing the files, but I'll come back to this later.
  3512.                     END IF
  3513.  
  3514.                 '** Reset to not display group
  3515.                 DisplayGroup = 0
  3516.                 END IF
  3517.  
  3518.                 '** Find out if this is the start of a new section or the end of an old section.
  3519.                 FoundStr% = INSTR(1,LCASE$(Buffer$), SECTIONSTART)
  3520.                 if (FoundStr% <> 0)  THEN
  3521.                     FoundStr1% = INSTR(1,LCASE$(Buffer$), SECTIONEND)
  3522.                     if (FoundStr% <> 0) THEN
  3523.                         Title$ = MID$(Buffer$, (FoundStr% + 1), (FoundStr1% - FoundStr% - 1))
  3524.                         gDeleteDialogText$ = Title$
  3525.                         tmp$ = MID$(Buffer$, 2, 1)
  3526.                         IF tmp$ <> "*" THEN DisplayGroup% = 1
  3527.                         ''IF tmp$ = "*" THEN PRINT "Won't be showing Group !"+Title
  3528.                         ''IF tmp$ <> "*" THEN PRINT "Will be showing Group !"+Title
  3529.  
  3530.                     End IF
  3531.                 END IF
  3532.                 ItemsInGroup% = 1
  3533.                 InGroup=1
  3534.  
  3535.             CASE 4    '** Normal line of text.
  3536.                 FoundStr = INSTR(1,LCASE$(Buffer$),SEPERATOR)        '' Search line for seperator
  3537.                 IF FoundStr% <> 0 Then
  3538.                     LineLength% = LEN(Buffer$)
  3539.                     FileName$ = LEFT$(Buffer$,FoundStr% - 1)
  3540.                     ChapterName$ = RIGHT$(Buffer$,LineLength - (FoundStr%))
  3541.                     FileName$ = Lot_GetChapterValStr(ChapterName$,F_DESTDIR)+FileName$
  3542.                     Found% = DoesFileExist(FileName$,0)
  3543.  
  3544.                     IF Found% <> 0 Then
  3545.                         '** We need to check here if the group is on of the groups currently 
  3546.                         '** selected for install. If not then we should not delete these files.
  3547.                         IF Lot_GetChapterValInt(ChapterName$,F_DISPLAY) = VISIBLE  AND _
  3548.                                 Lot_GetChapterValInt(ChapterName$,F_INOROUT) = INLIST THEN
  3549.                         
  3550.                             SetListItem "IDC_LIST1", ItemsInGroup%, FileName$
  3551.                             AddListItem SYM_UPDATELIST$, "IDC_LIST1"
  3552.                             ItemsInGroup% = ItemsInGroup% + 1
  3553.                             IF DisplayGroup = 0 AND gDebugGetObs% = 1 THEN PRINT "Removing File :"+FileName$
  3554.                             IF DisplayGroup = 0 THEN RemoveFile FileName$, cmoNone
  3555.                             IF DisplayGroup = 1 AND gDebugGetObs% = 1 THEN Print "Processing file: "FileName$
  3556.                         END IF
  3557.                     END IF
  3558.                 ELSE 
  3559.                     IF LENB(Buffer$) <> 0 THEN
  3560.                         notused% = DoMsgBox("File "+OBSFILE+" Error on: "+Buffer$, "not.lso", MB_OK)
  3561.                     END IF
  3562.                 END IF
  3563.  
  3564.             CASE Else
  3565.             IF gDebugGetObs% = 1 THEN PRINT "Doing Default"
  3566.  
  3567.         End Select
  3568.     LOOP UNTIL LineType% = 1
  3569.     CLOSE(FileNumber%)
  3570. End Function
  3571.  
  3572. FUNCTION GetLine(File%,buffer$) AS INTEGER
  3573. '** Purpose:   Read in a new line from file and determine the format of 
  3574. '**            the line.
  3575. '**             
  3576. '** OUT symbols:    GetLine = 1; End of file found.
  3577. '**                    GetLine = 2; Line is a comment.
  3578. '**                    GetLine = 3; Line is start of new section.
  3579. '**                    GetLine = 4; Normal line of text.
  3580. '**                    IDC_TEXT is the group description.
  3581. '** In Symbols:     File% - File handle
  3582. '**                    buffer$ - To return string.
  3583. '**     
  3584. '** Author:  Michael Clark
  3585. '** Arguments:
  3586. '**     
  3587. '**     
  3588. '*************************************************************************
  3589.  
  3590.     LINE INPUT #File%, buffer$
  3591.  
  3592.     if EOF(File%) Then
  3593.         GetLine = 1
  3594.     ElseIf (Left$(buffer$,1) = COMMENT) Then
  3595.         GetLine = 2
  3596.     ElseIf (Left$(buffer$,1) = SECTIONSTART) Then
  3597.         GetLine = 3
  3598.     Else
  3599.         GetLine = 4
  3600.     END IF
  3601. End Function
  3602.  
  3603. PUBLIC FUNCTION SERVERSWITCH(Chapter$,fInCopy%) AS INTEGER
  3604.     DIM notused%
  3605.  
  3606.     IF Lot_GetChapterValInt(Chapter$,F_INOROUT) = INLIST THEN
  3607.         '** If the user Turned On the Server be sure that the Program file are selected.
  3608.         notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESPROGRAM"),F_INOROUT,INLIST)
  3609.         gKitType = "2"
  3610.     ELSE
  3611.         '** If the user Turned Off the Server be sure that the Program file are de-selected.
  3612.         notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("NOTESPROGRAM"),OUTOFLIST)
  3613.         gKitType$ = "1"
  3614.     END IF
  3615.  
  3616.     ServerSwitch = SUCCESS
  3617. END FUNCTION
  3618.  
  3619. PUBLIC FUNCTION AUTOLOGONSWITCH(Chapter$,fInCopy%) AS INTEGER
  3620.     DIM dum%
  3621.     IF fInCopy% = 1 THEN    
  3622.         IF GetSymbolValue(SYM_AUTOMATIONINST$) = gFALSE$ THEN
  3623.             dum% = DoMsgBox("If you are selecting to install Notes Single Password Logon, be sure you are the Administrator of this system.","WARNING",MB_OK)
  3624.         END IF
  3625.     END IF
  3626.     AUTOLOGONSWITCH = SUCCESS
  3627. END FUNCTION
  3628.  
  3629. PUBLIC FUNCTION NTUSERSYNC(Chapter$,fInCopy%) AS INTEGER
  3630.     DIM dum%
  3631.     IF fInCopy% = 1 THEN    
  3632.         IF GetSymbolValue(SYM_AUTOMATIONINST$) = gFALSE$ THEN
  3633.                 dum% = DoMsgBox("If you are selecting to install NT User synchronization, be sure you are the Administrator of this system.","WARNING",MB_OK)
  3634.         END IF
  3635.     END IF
  3636.     NTUSERSYNC = SUCCESS
  3637. END FUNCTION
  3638.  
  3639. PUBLIC FUNCTION PDATASWITCH(Chapter$,fInCopy%) AS INTEGER
  3640.     DIM TmpChapter$, dum%
  3641.  
  3642.     IF Lot_GetChapterValInt(Chapter$,F_INOROUT) = 1 THEN
  3643.  
  3644.         '** Turn on Notes.ini Section
  3645.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESSMI")
  3646.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,1)
  3647.  
  3648.         '** Turn on CTL3DNT files.
  3649.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAMWIN95")
  3650.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,1)
  3651.  
  3652.         '** Turn on CTL3DNT files.
  3653.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAMWINNT")
  3654.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,1)
  3655.  
  3656.     ELSE
  3657.  
  3658.         '** Turn off Notes.ini Section
  3659.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESSMI")
  3660.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,0)
  3661.  
  3662.         '** Turn off CTL3DNT files.
  3663.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAMWIN95")
  3664.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,0)
  3665.  
  3666.         '** Turn off CTL3DNT files.
  3667.         TmpChapter$ = Lot_GetChapterFromKeyWord("NOTESPROGRAMWINNT")
  3668.         dum% = Lot_SetChapterFilesInCopyListInOrOut(TmpChapter$ ,0)
  3669.  
  3670.     END IF
  3671.     PDATASWITCH = SUCCESS
  3672.     
  3673. END FUNCTION
  3674.  
  3675. PUBLIC FUNCTION PROGSWITCH(Chapter$,fInCopy%) AS INTEGER
  3676.     DIM TmpChapter$, dum%
  3677.  
  3678.     '** Turn on Notes.ini Section
  3679.     IF gNotesIni$ <> "" THEN
  3680.         if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ is not blank and the user turned off the Notes program seciton"
  3681.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESINI") ,OUTOFLIST)
  3682.     END IF
  3683.  
  3684.     IF Lot_GetChapterValInt(Chapter$,F_INOROUT) = 1 THEN
  3685.  
  3686.         '** Turn on Notes Program data
  3687.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMDATA") ,INLIST)
  3688.  
  3689.         '** Turn on CTL3DNT files.
  3690.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMWIN95") ,INLIST)
  3691.  
  3692.         '** Turn on CTL3DNT files.
  3693.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMWINNT") ,INLIST)
  3694.  
  3695.     ELSE
  3696.         '** Turn off Notes Program data
  3697.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMDATA") ,OUTOFLIST)
  3698.  
  3699.         '** Turn off CTL3DNT files.
  3700.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMWIN95") ,OUTOFLIST)
  3701.  
  3702.         '** Turn off CTL3DNT files.
  3703.         dum% = Lot_SetChapterFilesInCopyListInOrOut(Lot_GetChapterFromKeyWord("NOTESPROGRAMWINNT") ,OUTOFLIST)
  3704.  
  3705.     END IF
  3706.     PROGSWITCH = SUCCESS
  3707.     
  3708. END FUNCTION
  3709.  
  3710. '*************************************************************************
  3711. '**    FUNCTION ADVANCEDSWITCH(Chapter$,fInCopy%) AS INTEGER
  3712. '** 
  3713. '** Purpose: This is module display the Advanced server Lic. information.
  3714. '**            for Billing and Clusters.
  3715. '** Author:    Michael Clark
  3716. '** Arguments: None
  3717. '** Returns:
  3718. '**
  3719. '*************************************************************************
  3720. PUBLIC FUNCTION ADVANCEDSWITCH(Chapter$,fInCopy%) AS INTEGER
  3721. Dim WorkChapter$, dum%, direction$
  3722.  
  3723.     IF fInCopy% = 1 THEN    '** User has selected to Install Advanced Services.
  3724.         direction$ = PopupModalDlg (DB_LICENCES, DB_LICENCES)
  3725.         IF direction$ = gBACK Then
  3726.             ADVANCEDSWITCH = FAILURE
  3727.             EXIT FUNCTION
  3728.          End IF
  3729.     END IF    
  3730.     ADVANCEDSWITCH = SUCCESS
  3731.  
  3732. END FUNCTION
  3733. '*************************************************************************
  3734. '**    FUNCTION NETNOTESSWITCH(Chapter$,fInCopy%) AS INTEGER
  3735. '** 
  3736. '** Purpose: This function sets up for a Partioned Server Install
  3737. '**            
  3738. '** Author:    Michael Clark
  3739. '** Arguments: Chapter - Chapter being processed
  3740. '**                fInCopy - 1 Chapter is selected 2 Chapter is de-selected
  3741. '** Returns:    SUCCESS/FAILURE
  3742. '**
  3743. '*************************************************************************
  3744. PUBLIC FUNCTION NETNOTESSWITCH(Chapter$,fInCopy%) AS INTEGER
  3745. Dim WorkChapter$, dum%, direction$, notused%
  3746.     '** Get the chapter for Notes.ini so we can turn it off
  3747.     '** if we want.
  3748.  
  3749.     '** If the Partitioned Server hasn't been installed on this system
  3750.     '** then display the Lic. dialog. If the partitioned server has already
  3751.     '** been selected or this is a second install then don't show the lic.
  3752.     IF fInCopy% = 1 THEN    '** User selected Item
  3753.         '** If the Partitioned server hasn't been installed Display Lic.
  3754.         IF gPartitioned = 0 THEN 
  3755.             '** Show the user the Lic. Warning. DO this only on the First Install
  3756.             direction$ = PopupModalDlg (DB_LICENCES, DB_LICENCES)
  3757.  
  3758.             '** User has not excepted the lic aggrement so DON'T install
  3759.             '** this option.
  3760.             IF direction$ = gBACK Then        '** User does not accept.
  3761.  
  3762.                 '** Install standard Notes.ini file on if we have not found one already.
  3763.                 IF gNotesIni$  <> "" THEN
  3764.                     if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because the user did not accept the Lic. and we already have a notes.ini"
  3765.                     notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,OUTOFLIST)
  3766.                 ELSE
  3767.                     if gDebugNotesIni = 1 THEN PRINT "Turning on notes.ini because the user did not accept the Lic. and we do not have a notes.ini"
  3768.                     notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,INLIST)
  3769.                 END IF
  3770.                 '** Default setting for Server.
  3771.                 notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESSERVER"),F_INOROUT,INLIST)
  3772.  
  3773.                 '** Make Notes Advanced Services (Program files) selection de-selected
  3774.                 notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("PARTITION"),F_INOROUT,OUTOFLIST)
  3775.  
  3776.                 '** Make Notes Advanced Services (Program files) selection de-selected
  3777.                 notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("ADVANCEDSERVICE"),F_INOROUT,OUTOFLIST)
  3778.  
  3779.                 '** Make Notes Advanced Services (Program files) selection de-selected
  3780.                 notused% = Lot_SetChapterFilesInCopyListInOrOut (Lot_GetChapterFromKeyword("ADVANCEDSERVICEDATA"),OUTOFLIST)
  3781.  
  3782.                 gPartitioned% = 0
  3783.                 if gDebugPartition = 1 THEN PRINT "Setting Partitons OFF because User doesn't agree."
  3784.                 NETNOTESSWITCH = SUCCESS
  3785.                 EXIT FUNCTION    '** Because user doesn't agree to Lic.
  3786.  
  3787.             ELSE    '** User excepts the Lic. so set for Partioned install.
  3788.                 if gDebugPartition = 1 THEN PRINT "Setting Partitons ON because User agrees."
  3789.                 gPartitioned% = 1
  3790.                 '** Turn of install of Normal notes.ini in system dir.
  3791.                 if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because of partitions have been selected"
  3792.                 notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,OUTOFLIST)
  3793.             END IF
  3794.     
  3795.         ELSE
  3796.             '** gPartitioned is already on so don't display lic and 
  3797.             '** set for another Partitioned Server install.
  3798.             if gDebugPartition = 1 THEN PRINT "Partitons are ON, so set up default selections."
  3799.             if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ because partitions"
  3800.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,OUTOFLIST)
  3801.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESSERVER"),F_INOROUT,OUTOFLIST)
  3802.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("ADVANCEDSERVICEDATA"),F_INOROUT,OUTOFLIST)
  3803.             gPartitioned% = 1
  3804.         END IF
  3805.  
  3806.     ELSE 
  3807.         '** If this is a second partition install the user shouldn't be turning off
  3808.         '** any of the partition stuff
  3809.         '** User de-selected Partioned server so reset everything.
  3810.         '** keep in mind this is not the way to Install a Server or Client
  3811.         '** if you have already Installed a Partioned server.
  3812.         '** ADD User Warning for 4.51 !!!!!!
  3813.  
  3814.         if gDebugPartition = 1 THEN PRINT "If partitions were orignaly on the user shouldn't change this, it turns off gPatrtitioned."
  3815.         if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ is not blank"
  3816.         IF gNotesIni$ <> "" THEN
  3817.             if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ because partitions"
  3818.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,OUTOFLIST)
  3819.         ELSE
  3820.             if gDebugNotesIni = 1 THEN PRINT "Turning off notes.ini because gNotesIni$ because partitions"
  3821.             notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESINI"),F_INOROUT,INLIST)
  3822.         END IF        
  3823.         notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("NOTESSERVER"),F_INOROUT,INLIST)
  3824.         notused% = Lot_SetChapterValInt (Lot_GetChapterFromKeyword("PARTITION"),F_INOROUT,OUTOFLIST)
  3825.  
  3826.         gPartitioned% = 0
  3827.     END IF    
  3828.     NETNOTESSWITCH = SUCCESS
  3829.  
  3830. END FUNCTION
  3831.  
  3832. FUNCTION WriteNotesReg(prodno%) AS INTEGER
  3833. '*************************************************************************
  3834. '**    FUNCTION WriteNotesReg(prodno%) AS INTEGER
  3835. '** 
  3836. '** Purpose: To register a bunch of different things into the registry
  3837. '**            
  3838. '** Author:    Michael Clark (items to register by Jack Ozzie)
  3839. '** Arguments: None
  3840. '** Returns:
  3841. '**
  3842. '*************************************************************************
  3843. DIM Pos%, Buffer AS STRING, Buffer1 AS STRING
  3844. DIM NotesFile AS INTEGER, NotesFileTmp AS INTEGER, exepath$
  3845. DIM ShellCommand$, ShellResult%, Buffer2$, Pos2%, notused%
  3846. DIM RegKey$, RegValue$, ErrCode%, RegKeyId$, RegStatus&, Answer&
  3847. DIM HKEYVAL&
  3848.     ON ERROR RESUME NEXT        '** Allow error handeling
  3849.  
  3850.     IF gDebugWriteNotesReg% = 1 OR gDebugNotes% = 1 THEN PRINT "Notes Reg Called"
  3851.     '** Create the file names
  3852.     gNotesReg$ = MakePath (GetSymbolValue("NOTDIR"), "notesw32.reg")
  3853.     gNotesRegTmp$ = MakePath (GetSymbolValue("NOTDIR"), "notesw32.tmp")
  3854.  
  3855.     '** Get input file handle
  3856.     NotesFile = FREEFILE()
  3857.     OPEN gNotesReg$ FOR INPUT as NotesFile
  3858.  
  3859.     '** Get output file handle
  3860.     NotesFileTmp = FREEFILE()
  3861.     OPEN gNotesRegTmp$ FOR OUTPUT as NotesFileTmp
  3862.  
  3863.     exepath$ = Lot_WhereIsFeature(prodno%, "NOTESPROGRAM", LdString(SID_NOT_NOTES))
  3864.  
  3865.     DO WHILE NOT EOF(NotesFile)
  3866.         LINE INPUT #NotesFile, Buffer
  3867.         Pos% = instr(1, Buffer$, "%notesdir%")
  3868.         if Pos% > 0 Then
  3869.             '' We found a string  now insert the paths to notes.
  3870.             Pos2% = LEN(Buffer$) - (Pos% + LEN("%notesdir%") - 1)
  3871.             Buffer1$ = LEFT$(Buffer$, Pos% - 1)
  3872.             Buffer2$ = RIGHT$(Buffer$, Pos2%)
  3873.  
  3874.             Buffer1$ = Buffer1$+exepath$+Buffer2$
  3875.             Print #NotesFileTmp, Buffer1$
  3876.         else
  3877.             Print #NotesFileTmp, Buffer$
  3878.         END IF
  3879.  
  3880.     LOOP
  3881.     CLOSE NotesFile%
  3882.     CLOSE NotesFileTmp%
  3883.  
  3884.     '** Get input file handle
  3885.     NotesFileTmp = FREEFILE()
  3886.     OPEN gNotesRegTmp$ FOR input as NotesFileTmp
  3887.     IF ErrCode <> 0 THEN PRINT "The error returned from Opening "+gNotesRegTmp$+" is "+STR$(ErrCode)
  3888.  
  3889.     DO WHILE NOT EOF(NotesFileTmp)
  3890.         LINE INPUT #NotesFileTmp, Buffer$
  3891.         Pos% = instr(1,Buffer$,"=")
  3892.         IF Pos% > 0 THEN
  3893.             Pos2% = LEN(Buffer$) - Pos% + 1
  3894.             RegKey$ = TRIM$(LEFT$(Buffer$, Pos% - 1))
  3895.             RegValue$ = TRIM$(RIGHT$(Buffer$, Pos2% - 1))
  3896.             Pos% = instr(1,RegKey,"\")
  3897.             RegKeyId$ = TRIM$(LEFT$(RegKey$, Pos% - 1))
  3898.             RegKey$ = TRIM$(RIGHT$(RegKey$, (LEN(RegKey$) - Pos%)))
  3899.             '** If the registration key already exist then don't try to create,
  3900.             '** just add the new value.
  3901.  
  3902.             SELECT CASE RegKeyId$
  3903.  
  3904.                 CASE "HKEY_CLASSES_ROOT"
  3905.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3906.  
  3907.                 CASE "HKEY_CURRENT)USER"
  3908.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3909.  
  3910.                 CASE "HKEY_LOCAL_MACHINE"
  3911.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3912.  
  3913.                 CASE "HKEY_USERS"
  3914.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3915.  
  3916.                 CASE "HKEY_PERFORMANCE_DATA"
  3917.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3918.  
  3919.                 CASE "HKEY_PERFORMANCE_TEXT"
  3920.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3921.  
  3922.                 CASE "HKEY_PERFORMANCE_NLSTEXT"
  3923.                     HKEYVAL& = HKEY_CLASSES_ROOT
  3924.             END SELECT
  3925.  
  3926.             '** Check to see if the key already exist.
  3927.             regStatus&= Lot_DoesRegKeyExistEx(HKEYVAL&, RegKey$)
  3928.             IF regStatus&= 1 THEN
  3929.                 '** If the key already exist then add our value.
  3930.                 regStatus&= Lot_createRegKeyValueEx(HKEYVAL&, RegKey$,"",REG_SZ,RegValue$, LEN(RegValue) + 1)
  3931.                 regStatus&= Lot_RegisterObject("NOTESPROGRAM",UNIN_CLASS_REGISTRY_HIVE$,RegKeyId$+"\"+RegKey$)
  3932.                 if gDebugWriteNotesReg% = 1 OR gDebugNotes% = 1 THEN PRINT " Modified registry with :"+RegKeyId$+RegKey$+"="+RegValue$
  3933.             ELSE
  3934.                 '** Otherwise the key didnt' exist so we need to create it.
  3935.                 regStatus&= Lot_RegCreateKeyEx(HKEYVAL&, RegKey$)
  3936.                 regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEYVAL&, RegKey$, "", REG_SZ,  RegValue$, LEN(RegValue$) + 1)
  3937.                 regStatus&= Lot_RegisterObject("NOTESPROGRAM",UNIN_CLASS_REGISTRY_HIVE$,RegKeyId$+"\"+RegKey$)
  3938.                 if gDebugWriteNotesReg% = 1 OR gDebugNotes% = 1 THEN PRINT " Added registry with :"+RegKeyId$+RegKey$+"="+RegValue$
  3939.             END IF
  3940.         END IF
  3941.     LOOP
  3942.  
  3943.     CLOSE NotesFileTmp%
  3944.  
  3945. '    notused% = Lot_RegisterObject("NOTESPROGRAM",UNIN_CLASS_FILE$,+GetListItem("NOTDIR",1) + "notesw32.reg")
  3946.     FILECOPY GetSymbolValue("NOTDIR")+"notesw32.tmp", GetSymbolValue("NOTDIR")+"notesw32.reg"
  3947.     KILL GetSymbolValue("NOTDIR")+"notesw32.tmp"
  3948. END FUNCTION
  3949.  
  3950. '*************************************************************************
  3951. '** FUNCTION FUNCTION GetNotesPathFromLotusIni() AS String
  3952. '**'** Purpose: Gets the product dir path from Lotus.ini file, and searches for
  3953. '**          notes.exe in the dir. 
  3954. '**            
  3955. '** Author:    JYOTI KEDIA
  3956. '** Arguments: None
  3957. '** Returns:   if notes.exe does not exist in dir specified in lotus.ini, it
  3958. '**            returns "", otherwise returns the full path to the product.
  3959. '*************************************************************************
  3960. FUNCTION GetNotesPathFromLotusIni() AS String
  3961.      DIM DestDir$, lotusinipath$, defdir$, temp%, proddir$, fullpath$, rv%
  3962.  
  3963.    DestDir$ = GetWindowsDir()
  3964.    lotusinipath$ = MakePath(DestDir$,"LOTUS.INI")
  3965.  
  3966.    if DoesFileExist(lotusinipath$,femExists) then
  3967.       defdir$ = GetIniKeyString(lotusinipath$,"Lotus Applications", "NOTES")
  3968.       if defdir$ <> "" then
  3969.          temp% = INSTR(1,LCASE$(defdir$),"notes.exe")
  3970.          if temp% <> 0 then
  3971.             ProdDir$ = MID$(defdir$,1,(temp%-1))
  3972.             if ProdDir$ <> "" then
  3973.                fullpath$ = ProdDir$ + "notes.exe"
  3974.                if DoesFileExist(fullpath$, femExists) then
  3975.                   rv% = Lot_CleanPath(fullpath$)
  3976.                   GetNotesPathfromLotusIni = fullpath$
  3977.                   EXIT FUNCTION
  3978.                end if 
  3979.             end if 
  3980.          end if 
  3981.       end if 
  3982.    end if
  3983.  
  3984.    GetNotesPathfromLotusIni = ""
  3985.  
  3986. END FUNCTION
  3987.  
  3988. '*************************************************************************
  3989. '** SUB WriteMAPIRegForNOT(network$, prodno%)
  3990. '**
  3991. '** Purpose:    This function writes OLE registration needed
  3992. '** Author:     Michael Clark
  3993. '** Arguments:  
  3994. '** Returns:    SUCCESS
  3995. '*************************************************************************
  3996.  
  3997. SUB WriteMAPIRegForNOT(network$, prodno%)
  3998. DIM DestDir$, Found%
  3999.  
  4000.     '** Get the location of the Windows System Directory. Keep in mind that if this is
  4001.     '** a shared install i.e. W95 system files reside on a READ-ONLY file server then
  4002.     '** the WINSYSDIR symbol in CIT will be set to the users Local Win dir.
  4003.  
  4004.     DestDir$ = MakePath (GetSymbolValue("WINSYSDIR"), "mapisvc.inf")
  4005.     if gDebugWriteMapi = 1 THEN PRINT "The destination dir for MAPI is :"+DestDir$
  4006.     found% = DoesFileExist(DestDir$, 0)
  4007.     IF Found = 1 Then
  4008.         GOTO WriteFile        
  4009.     ELSE
  4010.         DestDir$ = MakePath (GetSymbolValue("WINSYSDIR"), "notespis.inf")
  4011.     END IF
  4012. WriteFile:
  4013.     CreateIniKeyValue DestDir$, "Services", "NOTES", "Lotus Notes Mail", cmoOverwrite
  4014.  
  4015.     CreateIniKeyValue DestDir$, "NOTES", "PR_SERVICE_DLL_NAME", "nwnsp.dll", cmoOverwrite
  4016.     CreateIniKeyValue DestDir$, "NOTES", "PR_SERVICE_SUPPORT_FILES", "nwnsp.dll", cmoOverwrite
  4017.     CreateIniKeyValue DestDir$, "NOTES", "PR_SERVICE_DELETE_FILES", "nwnsp.dll", cmoOverwrite
  4018.     CreateIniKeyValue DestDir$, "NOTES", "PR_SERVICE_ENTRY_NAME", "ServiceEntry", cmoOverwrite
  4019.     CreateIniKeyValue DestDir$, "NOTES", "Providers", "NAB,NMS,NXP", cmoOverwrite
  4020.     CreateIniKeyValue DestDir$, "NOTES", "WIZARD_ENTRY_NAME", "ServiceWizard", cmoOverwrite
  4021.     CreateIniKeyValue DestDir$, "NOTES", "PR_RESOURCE_FLAGS", "SERVICE_SINGLE_COPY|SERVICE_PRIMARY_IDENTITY", cmoOverwrite
  4022.  
  4023.     CreateIniKeyValue DestDir$, "NAB", "PR_PROVIDER_DLL_NAME", "nwnsp.dll", cmoOverwrite
  4024.     CreateIniKeyValue DestDir$, "NAB", "PR_RESOURCE_TYPE", "MAPI_AB_PROVIDER", cmoOverwrite
  4025.     CreateIniKeyValue DestDir$, "NAB", "PR_DISPLAY_NAME", "Lotus Notes Address Book", cmoOverwrite
  4026.     CreateIniKeyValue DestDir$, "NAB", "PR_PROVIDER_DISPLAY", "Lotus Notes Address Book", cmoOverwrite
  4027.     CreateIniKeyValue DestDir$, "NAB", "PR_RESOURCE_FLAGS", "STATUS_PRIMARY_IDENTITY", cmoOverwrite
  4028.  
  4029.     CreateIniKeyValue DestDir$, "NMS", "PR_PROVIDER_DLL_NAME", "nwnsp.dll", cmoOverwrite
  4030.     CreateIniKeyValue DestDir$, "NMS", "PR_RESOURCE_TYPE", "MAPI_STORE_PROVIDER", cmoOverwrite
  4031.     CreateIniKeyValue DestDir$, "NMS", "PR_RESOURCE_FLAGS", "STATUS_PRIMARY_IDENTITY|STATUS_DEFAULT_STORE", cmoOverwrite
  4032.     CreateIniKeyValue DestDir$, "NMS", "PR_PROVIDER_DISPLAY", "Lotus Notes Message Store", cmoOverwrite
  4033.     CreateIniKeyValue DestDir$, "NMS", "PR_DISPLAY_NAME", "Lotus Notes Message Store", cmoOverwrite
  4034.     CreateIniKeyValue DestDir$, "NMS", "PR_MDB_PROVIDER", "395d475fecf1cd1193dc5aab3C478538", cmoOverwrite
  4035.  
  4036.     CreateIniKeyValue DestDir$, "NXP", "PR_PROVIDER_DLL_NAME", "nwnsp.dll", cmoOverwrite
  4037.     CreateIniKeyValue DestDir$, "NXP", "PR_RESOURCE_TYPE", "MAPI_TRANSPORT_PROVIDER", cmoOverwrite
  4038.     CreateIniKeyValue DestDir$, "NXP", "PR_RESOURCE_FLAGS", "STATUS_PRIMARY_IDENTITY", cmoOverwrite
  4039.     CreateIniKeyValue DestDir$, "NXP", "PR_PROVIDER_DISPLAY", "Lotus Notes Transport", cmoOverwrite
  4040.     CreateIniKeyValue DestDir$, "NXP", "PR_DISPLAY_NAME", "Lotus Notes Transport", cmoOverwrite
  4041. END SUB
  4042.  
  4043.  
  4044. '*************************************************************************
  4045. '** PUBLIC FUNCTION InitLanguageNOT (prodno%, network$, direction$) 
  4046. '** Purpose: Finds out the installed languages and determines the nature
  4047. '**  of the install.  If not running automated, displays a message box for
  4048. '**  a reinstall or language install, for an upgrade, just continues
  4049. '**  
  4050. '** Author: JMDonohue
  4051. '** Arguments: (Not used -- to conform to product function spec)
  4052. '** Returns:  Install kind string
  4053. '**   
  4054. '**  Sets the following global symbols for later processing: 
  4055. '**   SYM_INSTALLKIND$
  4056. '**   SYM_REG_PRODUCTNAME$
  4057. '**   SYM_REG_PRODUCTVER$
  4058. '*************************************************************************
  4059. PUBLIC FUNCTION InitLanguageNOT (prodno%, network$, direction$) AS STRING
  4060.    DIM szProductName$, szProductVersion$, szInstallKind$, szLanguageSubdir$ 
  4061.    szProductName$ =  LdString(SID_NOT_NOTES_NAME)
  4062.    szProductVersion$ =  LdString(SID_NOT_CURRENT_VERSION)
  4063.     if prodno% = 1 THEN
  4064.         SetSymbolValue SYM_REG_PRODUCTNAME$ , szProductName$
  4065.         SetSymbolValue SYM_REG_PRODUCTVER$ , szProductVersion$ 
  4066.     END IF
  4067.    InitLanguages szProductName$, szProductVersion$, prodno%    
  4068.     InitLanguageNOT  = ""
  4069. END FUNCTION
  4070. SUB NOT_RegisterSharedComponent(Key$, FileName$, Version$)
  4071. '*************************************************************************
  4072. '** Purpose:    This product routines registers the shared component for the
  4073. '**                product and writes an entry in cinstall.ini for uninstall
  4074. '**
  4075. '** IN SYMBOLS  handle to dialog, Control ID, Class, Instance
  4076. '**     
  4077. '** Author: Michael Natsis (stolen from flw.lss by JMD)
  4078. '** Arguments:
  4079. '**    Key$            Shared section keyword, "WIN32SHRSMARTICONPRG", e.g.
  4080. '**    FileName$    Name of shared component, "Icon Palette", e.g.
  4081. '**    Version$        Version of shared component, "6.0", e.g.
  4082. '**     
  4083. '*************************************************************************
  4084. DIM szProductName$, szProductVersion$, RegKeyName$
  4085.  
  4086. szProductName$ =  LdString(SID_NOT_NOTES_NAME)
  4087. szProductVersion$ =  LdString(SID_NOT_CURRENT_VERSION)
  4088.  
  4089. IF Lot_IsTheFeatureInstalled(Key$) <> FALSE THEN
  4090.     RegKeyName$ = gREGLOTUS + szProductName$ + "\" + szProductVersion$ + _
  4091.      "\Components\" + FileName$ + "\" + Version$
  4092.     Lot_RegCreateKeyEx HKEY_LOCAL_MACHINE, RegKeyName$
  4093.    Lot_RegisterObject Key$, UNIN_CLASS_REGISTRY_KEY$, gHLM$ + "\" + RegKeyName$
  4094. END IF
  4095.  
  4096. END SUB
  4097. FUNCTION WritePartionedinfo(prodno%, network$) AS INTEGER
  4098. '*************************************************************************
  4099. '** Purpose:    This function get called every time an Partioned server is installed
  4100. '**                It will open the file vserver.ncf if it exist and increment
  4101. '**                the instance of the server. If the file doesn't exist it will
  4102. '**                be created and the instance of the server will be set to ONE.
  4103. '**
  4104. '** IN SYMBOLS  prodno%, network%
  4105. '**     
  4106. '** Author: Michael Clark
  4107. '**     
  4108. '**     Returns: Instance of the server as an integer.
  4109. '**     
  4110. '**     
  4111. '*************************************************************************
  4112. DIM lpBuf$, regStatus&, szKey$, InstanceLen&, Instance%, Tmp$, szkey2$
  4113.  
  4114. lpBuf$ = String(256,0)
  4115. InstanceLen& = CLNG(128)
  4116. szKey$ = gREGLOTUS+GetSymbolValue(SYM_REG_PRODUCTNAME$)+"\VSERVER"
  4117.  
  4118.     '** Find out if VSERVER is already installed.
  4119.     if gDebugPartionedNotesIni% = 1 THEN PRINT "Checking existance of :"+szKey$
  4120.     regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  4121.  
  4122.     if regStatus&= 1 then
  4123.         '** VSERVER is installed so retrieve the previous values.
  4124.         '** INSTANCE
  4125.         regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "INSTANCE", REG_SZ, lpBuf$, InstanceLen&)
  4126.         Instance% = VAL(lpBuf$)
  4127.  
  4128.         '** Increment the INSTANCE
  4129.         if gDebugPartionedNotesIni% = 1 THEN PRINT szKey$+" Value is :"+STR$(Instance%)
  4130.         IF (Instance% <=99) THEN
  4131.             Instance% = Instance% + 1
  4132.         END IF
  4133.         if gDebugPartionedNotesIni% = 1 THEN PRINT "The next instance is :"STR$(Instance%)
  4134.         WritePartionedInfo = Instance%
  4135.         gInstance% = Instance
  4136.  
  4137.         '** Update the registry with the new INSTANCE.
  4138.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "INSTANCE", REG_SZ, MID$(NULLTRIM(STR$(Instance%)),2,LEN(STR$(Instance%))) ,LEN(STR$(Instance%)))
  4139.         IF regStatus& <> ERROR_SUCCESS THEN
  4140.             RegErrorMsg SID_ERR_REG_NOTES, gHLM$+"\"+szKey$,"",""
  4141.         END IF
  4142.  
  4143.         '** Make a registry entry for the for the data directory using the instance
  4144.         szkey2$ = szKey$+"\"+"1"
  4145.         regStatus&= Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szkey2$)
  4146.         regStatus&= Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey2$,"CLIENT"+MID$(NULLTRIM(STR$(Instance%)),2,LEN(STR$(Instance%))), REG_SZ, GetSymbolValue("NOTWORKDIR") ,LEN(GetSymbolValue("NOTWORKDIR")) + 1)
  4147.         IF regStatus& <> ERROR_SUCCESS THEN
  4148.             RegErrorMsg SID_ERR_REG_NOTES, gHLM$+"\"+szKey$,"",""
  4149.         END IF
  4150.     
  4151.     ELSE
  4152.         '** Key Didn't exist so create the key and set the intital values.
  4153.         IF gDebugPartionedNOtesIni = 1 THEN PRINT "RegStatus for vserver is not 1"
  4154.         regStatus& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$)
  4155.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "PATH", REG_SZ, GetSymbolValue("NOTDIR"), LEN(GetSymbolValue("NOTDIR")) + 1)
  4156.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "INSTANCE", REG_SZ, "1" ,LEN("1") + 1)
  4157.  
  4158.         '** Enter Each instance of the client directory
  4159.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "CLIENT", REG_SZ, GetSymbolValue("NOTWORKDIR") ,LEN(GetSymbolValue("NOTWORKDIR")) + 1)
  4160.         WritePartionedinfo = 1
  4161.         gInstance% = 1
  4162.  
  4163.         '** Make a registry entry for the for the data directory using the instance
  4164.         regStatus&= Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey$+"\"+"1")
  4165.         Tmp$= MID$(NULLTRIM(STR$(gInstance%)),2,LEN(NULLTRIM(STR$(gInstance%))))
  4166.         regStatus&= regStatus+Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$+"\"+"1", "1"+Tmp$, REG_SZ, GetSymbolValue("NOTWORKDIR") ,LEN(GetSymbolValue("NOTWORKDIR")) + 1)
  4167.         IF regStatus& <> ERROR_SUCCESS THEN
  4168.             RegErrorMsg SID_ERR_REG_NOTES, gHLM$+"\"+szKey$,"",""
  4169.         END IF
  4170.  
  4171.     END IF    
  4172. END FUNCTION
  4173.  
  4174. PUBLIC FUNCTION PartionedCmdProc(instance%) AS INTEGER
  4175. DIM Buffer$, Partionedcmd$, FileNum as INTEGER
  4176.     ON ERROR RESUME NEXT
  4177.  
  4178.     Partionedcmd = MakePath(GetSymbolValue("NOTWORKDIR"), "nserve.bat")
  4179.     IF DoesFileExist(Partionedcmd$, 0) = 0 THEN
  4180.         if gDebugPartionedNotesIni% = 1 THEN PRINT "Createing Batch procedure "+Partionedcmd$
  4181.         FileNum = FREEFILE()
  4182.         Buffer$ = Lot_TrimEndSlash(NULLTRIM(gNotesPartitionedProg$))+"\"+LdString(SID_NOT_SERVER)+" ="+Lot_TrimEndSlash(GetSymbolvalue("NOTWORKDIR"))+"\notes.ini"
  4183.         OPEN Partionedcmd FOR OUTPUT As FileNum
  4184.         PRINT #FileNum, "Set NOTESPARTITION="+MID$(STR$(instance%),2,LEN(STR$(instance%)))
  4185.         PRINT #FileNum, "Start "Buffer$
  4186.         Close (FileNum%)
  4187.     END IF
  4188.  
  4189.     Partionedcmd = MakePath(GetSymbolValue("NOTWORKDIR"), "nclient.bat")
  4190.     IF DoesFileExist(Partionedcmd$, 0) = 0 THEN
  4191.         if gDebugPartionedNotesIni% = 1 THEN PRINT "Createing Batch procedure "+Partionedcmd$
  4192.         FileNum = FREEFILE()
  4193.         Buffer$ = Lot_TrimEndSlash(NULLTRIM(gNotesPartitionedProg$))+"\"+LdString(SID_NOT_NOTES)+" ="+Lot_TrimEndSlash(GetSymbolvalue("NOTWORKDIR"))+"\notes.ini"
  4194.         OPEN Partionedcmd FOR OUTPUT As FileNum
  4195.         PRINT #FileNum, "Set NOTESPARTITION="MID$(STR$(instance%),2,LEN(STR$(instance%)))
  4196.         PRINT #FileNum, "start "Buffer$
  4197.         Close (FileNum%)
  4198.     END IF
  4199. END FUNCTION
  4200.  
  4201.  
  4202. FUNCTION ReadInf(direction$) AS INTEGER
  4203. DIM InGroup%, LineType%, gNotesInf$, FileNumber%, Buffer$, Section$
  4204. DIM LineLength%, KeyValue$, KeyName$, FoundStr%, FoundStr1%, Buffer1$
  4205. DIM Buffer2$, Pos%, Pos2%
  4206.  
  4207.     InGroup% = 0            '** 0 - Not in group, 1 - in group
  4208.     LineType%=0                '** Current switch selector
  4209.  
  4210.     gNotesInf$ = MakePath (GetSymbolValue("WINSYSDIR"), "notespis.inf")
  4211.     FileNumber = FREEFILE()
  4212.     OPEN gNotesInf$ FOR INPUT as FileNumber%
  4213.  
  4214.     Do
  4215.         LineType% = GetLine(FileNumber%,Buffer$)
  4216.  
  4217.         Select Case LineType%
  4218.             CASE 1
  4219.                 Section$ = Buffer$
  4220.                 if gDebugReadInf% = 1 THEN PRINT "1 Current Section is :"+Buffer
  4221.  
  4222.             CASE 2    '** Comment or whitespace
  4223.                 ''** Don't do anything just skip the line.
  4224.  
  4225.             CASE 3        ''** Start of a new section.
  4226.                 FoundStr% = INSTR(1,LCASE$(Buffer$), SECTIONSTART)
  4227.                 if (FoundStr% <> 0)  THEN
  4228.                     FoundStr1% = INSTR(1,LCASE$(Buffer$), SECTIONEND)
  4229.                     if (FoundStr% <> 0) THEN
  4230.                         Section$ = MID$(Buffer$, (FoundStr% + 1), (FoundStr1% - FoundStr% - 1))
  4231.                         if gDebugReadInf% = 1 THEN PRINT "3 Current Section is :"+Section$
  4232.                     END IF
  4233.                 END IF
  4234.  
  4235.                 InGroup=1
  4236.  
  4237.             CASE 4
  4238.                 FoundStr = INSTR(1,LCASE$(Buffer$),SEPERATOR)        '' Search line for seperator
  4239.                 IF FoundStr% <> 0 THEN
  4240.                     LineLength% = LEN(Buffer$)
  4241.                     KeyName$ = LEFT$(Buffer$,FoundStr% - 1)
  4242.                     KeyValue$ = RIGHT$(Buffer$,LineLength - (FoundStr%))
  4243.                     if gDebugReadInf% = 1 THEN PRINT "KeyName is :"+KeyName$
  4244.                     if gDebugReadInf% = 1 THEN PRINT "KeyValue is :"+KeyValue$
  4245.  
  4246.                     Pos% = instr(1, KeyValue$, "%notesdir%")
  4247.                     if Pos% > 0 Then
  4248.                         '' We found a string  now insert the paths to notes.
  4249.                         Pos2% = LEN(KeyValue$) - (Pos% + LEN("%notesdir%") - 1)
  4250.                         Buffer1$ = LEFT$(KeyValue$, Pos% - 1)
  4251.                         Buffer2$ = RIGHT$(KeyValue$, Pos2%)
  4252.  
  4253.                         Buffer1$ = Buffer1$+GetListItem("NOTDIR",1)+Buffer2$
  4254.                         if gDebugReadInf% = 1 THEN PRINT "inf File entry is :"+KeyName$+" = "+Buffer2$
  4255.                     else
  4256.                         if gDebugReadInf% = 1 THEN PRINT "inf File entry is :"+KeyName$+" = "+KeyValue$
  4257.                     END IF
  4258.                 END IF
  4259.         CASE Else
  4260.  
  4261.         End Select
  4262.     LOOP UNTIL LineType% = 1
  4263.     Close(FileNumber%)
  4264. End Function
  4265. '*************************************************************************
  4266. '** Purpose:    This function return the location of a given file
  4267. '**
  4268. '** IN SYMBOLS  Path$, FileName$
  4269. '**     
  4270. '** Author: Michael Clark
  4271. '**     
  4272. '**     Returns: Path of FileName or "" if not found
  4273. '**     
  4274. '**     
  4275. '*************************************************************************
  4276. FUNCTION DoesFileExistOnPath (Path$, FileName$) AS STRING
  4277.  
  4278.     DIM Str1$, StrLoc1%, EnvPos1%, EnvPos2%, LengthOfRemainingString%
  4279.     DIM LocString%, DUM%
  4280.     DIM SearchString$
  4281.     DIM TmpStr$, TmpStr1$, RemainingString$
  4282.     DIM SEPERATOR$
  4283.     DIM ENVCHAR$
  4284.     DIM StringLength%
  4285.  
  4286.     ENVCHAR$="%"
  4287.     SEPERATOR$=";"    
  4288.  
  4289.     '** Chack to see if we even have a path
  4290.     IF Path$ = "" THEN Path$=GetEnvVariableValue("PATH")
  4291.     
  4292.     '** Trim off any traling spaces.
  4293.     Str1$ = RTRIM(path$)
  4294.     '** Get the strings current length.
  4295.     StringLength% = LEN(Str1$)
  4296.     IF gDebugDoesFileExistOnPath = 1 THEN Print "(DoesFileExistOnPath) Path variable returned :"+Str1$
  4297.     IF gDebugDoesFileExistOnPath = 1 THEN Print "Length of string is :"+STR$(StringLength)
  4298.  
  4299.     '** While the string length is not 0 search the string for individual
  4300.     '** paths to search for notes.ini.
  4301.     WHILE StringLength% <> 0
  4302.         IF gDebugDoesFileExistOnPath = 1 THEN Print "Next SearchString is:  "+Str1$
  4303.         
  4304.         '** Find the seperator in the line.
  4305.         StrLoc1% = 0    '** NOTE. Strings start at one (1).
  4306.         StrLoc1% = INSTR(1, str1$, SEPERATOR)
  4307.  
  4308.         '** If we don't have a seperator then treat the remaining string
  4309.         '** as the current search string. The end result should be that
  4310.         '** SearchString is some valid path.
  4311.         IF StrLoc1% <> 0 THEN
  4312.  
  4313.             '** Handel the case of the first character being a SEPERATOR.
  4314.             IF StrLoc1% = 1 THEN
  4315.                 '** Find the second SEPERATOR
  4316.                 StrLoc1% = INSTR(2, str1$, SEPERATOR)
  4317.                 IF gDebugDoesFileExistOnPath = 1 THEN Print "First character was a seperator in: "+Str1$
  4318.                 IF gDebugDoesFileExistOnPath = 1 THEN Print "The next seperator is located at position: "+STR$(StrLoc1)
  4319.                 '** Make sure we do not go past the end of line.
  4320.                 IF StrLoc1% = 0 THEN
  4321.                     LengthOfRemainingString = StrLoc1%
  4322.                     StrLoc1% = LEN(str1$)
  4323.                     IF gDebugDoesFileExistOnPath = 1 THEN Print "No trialing sepeartor was found so we used the string length of: "+STR$(StrLoc1)
  4324.                 ELSE
  4325.                     LengthOfRemainingString = LEN(str1$) - StrLoc1% - 2
  4326.                 END IF
  4327.                 SearchString$ = MID$(str1$, 2, StrLoc1% - 1)
  4328.                 IF gDebugDoesFileExistOnPath = 1 THEN Print "Search String is: "+SearchString$
  4329.  
  4330.             ELSE
  4331.                 '** otherwise copy the current string.
  4332.                 SearchString$ = LEFT$(str1$, StrLoc1% - 1)
  4333.                 LengthOfRemainingString = LEN(str1$) - StrLoc1% - 1
  4334.             END IF
  4335.             IF gDebugDoesFileExistOnPath = 1 THEN Print "The search String is:  "+SearchString$
  4336.  
  4337.             '** Now save the remaining string and get the new length of the string.
  4338.             Str1$ = RIGHT$(str1$, LengthOfRemainingString + 1)
  4339.             StringLength% = LEN(str1$)
  4340.             IF gDebugDoesFileExistOnPath = 1 THEN Print "The Remaining String is :"+Str1$" With a length of :"+STR$(LengthOfRemainingString)
  4341.         ELSE
  4342.             '** No seperator was found in the current string so treate the
  4343.             '** string as the current path to search. And set teh remaining
  4344.             '** string length to zero.
  4345.             SearchString$ = Str1$
  4346.             StringLength% = 0
  4347.             IF gDebugDoesFileExistOnPath = 1 THEN Print "Seperator not found so the Search String is :"+SearchString$
  4348.         END IF
  4349.  
  4350.  
  4351.     '** Find out if the current search string has any environment variables.
  4352.         IF gDebugDoesFileExistOnPath = 1 THEN Print "Searching current string: "+SearchString$+" for environment variables"
  4353.         EnvPos1% = INSTR(1, SearchString, ENVCHAR)
  4354.         IF EnvPos1%    <> 0 THEN        '** Env char found
  4355.             EnvPos2% = INSTR(EnvPos1% + 1, SearchString, ENVCHAR)
  4356.             TmpStr$ = MID$(SearchString$, EnvPos1% + 1, EnvPos2% - 2)
  4357.             RemainingString$ = MID$(SearchString$, EnvPos2%+2, LEN(SearchString))
  4358.  
  4359.             IF gDebugDoesFileExistOnPath = 1 THEN PRINT "The un-translated environment variable is: "+TmpStr$
  4360.             TmpStr$ = Lot_TrimEndSlash(GetEnvVariableValue(TmpStr$))
  4361.             IF RemainingString <>"" THEN
  4362.                 TmpStr$ = TmpStr$+"\"+RemainingString$
  4363.             ELSE
  4364.                 TmpStr$ = TmpStr$+RemainingString$
  4365.             END IF
  4366.             IF gDebugDoesFileExistOnPath = 1 THEN PRINT "Environment variable found so search :"+TmpStr$+"\"+FileName$
  4367.             dum% = DoesFileExist(TmpStr$+"\"+FileName$,0)
  4368.             IF dum% = 1 THEN 
  4369.                 IF gDebugDoesFileExistOnPath = 1 THEN PRINT "Notes.ini found in :"+TmpStr$
  4370.                 DoesFileExistOnPath = NULLTRIM(TmpStr$)
  4371.                 EXIT FUNCTION
  4372.             END IF
  4373.         ELSE
  4374.             TmpStr1$=NULLTRIM(SearchString$)+"\"+FileName$
  4375.             IF gDebugDoesFileExistOnPath = 1 THEN PRINT "No enviorenment variable found so search for FileName :"SearchString$+"\"+FileName$
  4376.             dum% = DoesFileExist(TmpStr1$,0)
  4377.             IF dum% = 1 THEN 
  4378.                 IF gDebugDoesFileExistOnPath = 1 THEN PRINT "Notes.ini found in :"+TmpStr$
  4379.                 DoesFileExistOnPath = NULLTRIM(SearchString$)
  4380.                 EXIT FUNCTION
  4381.             END IF
  4382.         END IF
  4383.  
  4384.     WEND
  4385.     DoesFileExistOnPath = ""
  4386. END FUNCTION
  4387.  
  4388.  
  4389. '*************************************************************************
  4390. '**    FUNCTION IsNotesInRegistry(NotesPath$) As INTEGER
  4391. '** Purpose:   Search for Notes entry in the registry.
  4392. '**                For V4 we can find the Notes program directory in the registry
  4393. '**                by looking for HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\4.0 and
  4394. '**                retrieve the PATH entry.
  4395. '**
  4396. '** RETURNS:    TRUE if found
  4397. '**
  4398. '** OUT symbols:
  4399. '**                     NotesPath$    = location of Notes executables.
  4400. '**             
  4401. '**     
  4402. '** Author:  Michael Clark
  4403. '** Arguments:
  4404. '**     
  4405. '**     
  4406. '*************************************************************************
  4407. FUNCTION IsNotesInRegistry(NotesFromRegPath$) As INTEGER
  4408.  
  4409.     DIM regStatus&                    '** Return status from registry calls.
  4410.     DIM szKey$                        '** Registry key.
  4411.     DIM NotesFromRegLen&            '** Length of string returned from registry.
  4412.     DIM SearchFile$                    '** 
  4413.  
  4414.     ON Error RESUME NEXT
  4415.     '****************************************************************
  4416.     '** Set Up the default key to search for and see if we can find it in the registry.
  4417.     '** HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\SID_NOT_CURRENT_VERSION
  4418.     '** i.e.
  4419.     '** HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\4.0
  4420.     '**
  4421.     '**
  4422.  
  4423.  
  4424.     '** Find out if the registry key for Notes is installed on this system.
  4425.     '** If the key is found, retrieve the executabel path from the PATH key word.
  4426.  
  4427.     szKey$ = gREGLOTUS+LdString(SID_NOT_NOTES_NAME)+"\"+LdString(SID_NOT_CURRENT_VERSION)
  4428.     IF gDebugNotesInRegistry% = 1 THEN PRINT "Search for key :"+szKey$
  4429.     regStatus& = Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szkey$)
  4430.  
  4431.     IF regStatus& = 1 THEN
  4432.         IF gDebugNotesInRegistry% = 1 THEN PRINT "Key found. regStatus is:"+STR$(regStatus&)" Retrieving Path Now"
  4433.         regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, _
  4434.                                         szKey$,_
  4435.                                         "PATH", _
  4436.                                         REG_SZ, _
  4437.                                         NotesFromRegPath$, _
  4438.                                         NotesFromRegLen&)
  4439.  
  4440.         '** Make sure the string is not NULL terminated.
  4441.         NotesFromRegPath$ = NULLTRIM(NotesFromRegPath$)
  4442.         IF gDebugNotesInRegistry% = 1 THEN PRINT "Path to Notes is:"+NotesFromRegPath$
  4443.  
  4444.         '** Validate the path we found and verify that the registry call was successful.
  4445.         '** Also verify that the user din't delete notes.
  4446.         '** if it is then set the global Notes directory to point to this directory,
  4447.         '** otherwise set it = "".
  4448.         SearchFile$ = Lot_TrimEndSlash(NotesFromRegPath$)+"\"+ANYVERSION
  4449.  
  4450.         IF (ValidatePath(NotesFromRegPath$) = FALSE) OR  (DIR$(SearchFile$,0) = "") THEN
  4451.             NotesFromRegPath$ = ""
  4452.             IsNotesInRegistry% = FALSE
  4453.         END IF
  4454.         IsNotesInRegistry% = TRUE
  4455.     ELSE
  4456.         NotesFromRegPath$ = ""
  4457.         IsNotesInRegistry% = FALSE
  4458.     END IF
  4459. END FUNCTION
  4460.  
  4461. '*************************************************************************
  4462. '**    FUNCTION IsNotesDataInRegistry(NotesDataFromRegistry$) As INTEGER
  4463. '** Purpose:   Search for Notes entry in the registry.
  4464. '**                For V4 we can find the Notes program directory in the registry
  4465. '**                by looking for HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\4.0 and
  4466. '**                retrieve the PATH entry.
  4467. '**
  4468. '** RETURNS:    TRUE if found
  4469. '**
  4470. '** OUT symbols:
  4471. '**                     NotesPath$    = location of Notes executables.
  4472. '**             
  4473. '**     
  4474. '** Author:  Michael Clark
  4475. '** Arguments:
  4476. '**     
  4477. '**     
  4478. '*************************************************************************
  4479. FUNCTION IsNotesDataInRegistry(NotesDataFromRegistry$) As INTEGER
  4480.  
  4481.     DIM regStatus&                    '** Return status from registry calls.
  4482.     DIM szKey$                        '** Registry key.
  4483.     DIM NotesDataFromRegLen&        '** Length of string returned from registry.
  4484.  
  4485.     '****************************************************************
  4486.     '** Set Up the default key to search for and see if we can find it in the registry.
  4487.     '** HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\SID_NOT_CURRENT_VERSION
  4488.     '** i.e.
  4489.     '** HKEY_LOCAL_MACHINE\SOFTWARE\LOTUS\NOTES\4.0
  4490.     '**
  4491.     '**
  4492.  
  4493.  
  4494.     '** Find out if the registry key for Notes is installed on this system.
  4495.     '** If the key is found, retrieve the executabel path from the PATH key word.
  4496.  
  4497.     szKey$ = gREGLOTUS+LdString(SID_NOT_NOTES_NAME)+"\"+LdString(SID_NOT_CURRENT_VERSION)
  4498.     IF gDebugNotesInRegistry% = 1 THEN PRINT "Search for key :"+szKey$
  4499.     regStatus& = Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szkey$)
  4500.  
  4501.     IF regStatus& = 1 THEN
  4502.         IF gDebugNotesInRegistry% = 1 THEN PRINT "Key found. regStatus is:"+STR$(regStatus&)" Retrieving Path Now"
  4503.         regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, _
  4504.                                         szKey$,_
  4505.                                         "DATAPATH", _
  4506.                                         REG_SZ, _
  4507.                                         NotesDataFromRegistry$, _
  4508.                                         NotesDataFromRegLen&)
  4509.  
  4510.         '** Make sure the string is not NULL terminated.
  4511.         NotesDataFromRegistry$ = NULLTRIM(NotesDataFromRegistry$)
  4512.         IF gDebugNotesDataRegistry% = 1 THEN PRINT "Path to Notes is:"+NotesDataFromRegistry$
  4513.  
  4514.         '** Validate the path we found and verify that the registry call was successful.
  4515.         '** if it is then set the global Notes directory to point to this directory,
  4516.         '** otherwise set in the an empty string.
  4517.         IF ValidatePath(Lot_TrimEndSlash(NotesDataFromRegistry$)) = FALSE THEN
  4518.             NotesDataFromRegistry$ = ""
  4519.             IsNotesDataInRegistry% = FALSE
  4520.         END IF
  4521.         IsNotesDataInRegistry% = TRUE
  4522.     ELSE
  4523.         NotesDataFromRegistry$ = ""
  4524.         IsNotesDataInRegistry% = FALSE
  4525.     END IF
  4526. END FUNCTION
  4527.  
  4528. '*************************************************************************
  4529. '**    FUNCTION IsNotesOnPath(NotesFromPath$) As INTEGER
  4530. '** Purpose:   Search for Notes entry in the on the Enviornment PATH
  4531. '**
  4532. '** RETURNS:    TRUE if found
  4533. '**
  4534. '** OUT symbols:
  4535. '**                     NotesFromPath$    = location of Notes executables.
  4536. '**             
  4537. '**     
  4538. '** Author:  Michael Clark
  4539. '** Arguments:
  4540. '**     
  4541. '**     
  4542. '*************************************************************************
  4543. FUNCTION IsNotesOnPath(NotesFromPath$) AS INTEGER
  4544.  
  4545.     DIM foundstr%
  4546.     DIM szNotesW32StringsDll$        '** On NT this could be ALPAH or X86 so we need to swap strings (RESOURCE THIS)
  4547.     DIM rc%
  4548.  
  4549.     IF gDebugIsNotesOnPath = 1 THEN PRINT "Search for ?strings.dll on the Enviorment variable (PATH)."
  4550.     foundstr% = 0
  4551.     NotesFromPath$ = LCASE$(FindTargetOnEnvVar(W16_NOTES,"PATH"))
  4552.     IF NotesFromPath$ <> "" Then
  4553.         foundstr% = INSTR(1,LCASE$(NotesFromPath$),W16_NOTES)
  4554.     else
  4555.         '** Find out if the is ALPHA or INTEL.
  4556.         IF Environ("PROCESSOR_ARCHITECTURE") = "ALPHA" THEN
  4557.             szNotesW32StringsDll$ = "astrings.dll"
  4558.         ELSE
  4559.             szNotesW32StringsDll$ = "nstrings.dll"
  4560.         END IF
  4561.         NotesFromPath$ = LCASE$(FindTargetOnEnvVar(szNotesW32StringsDll$,"PATH"))
  4562.         IF NotesFromPath$ <> "" Then
  4563.             foundstr% = INSTR(1,LCASE$(NotesFromPath$),szNotesW32StringsDll$)
  4564.         else
  4565.             NotesFromPath$ = LCASE$(FindTargetOnEnvVar(P16_NOTES,"PATH"))
  4566.             IF NotesFromPath$ <> "" Then
  4567.                 foundstr% = INSTR(1,LCASE$(NotesFromPath$),P16_NOTES)
  4568.             else
  4569.                 NotesFromPath$ = LCASE$(FindTargetOnEnvVar(P32_NOTES,"PATH"))
  4570.                 IF NotesFromPath$ <> "" Then
  4571.                     foundstr% = INSTR(1,LCASE$(NotesFromPath$),P32_NOTES)
  4572.                 else
  4573.                     NotesFromPath$ = ""
  4574.                 END IF
  4575.             END IF
  4576.         END IF
  4577.     END IF
  4578.     '** If we found ?strings then we know that notes is installed, so trim the strings.dll 
  4579.     '** from the returned value and save it. We don't need to validate the path because
  4580.     '** we know that the search did that.
  4581.     IF foundstr% <> 0 Then
  4582.         '** Strip "?strings.dll" from string
  4583.         NotesFromPath$ = MID$(NotesFromPath$,1,(foundstr%-1))
  4584.         rc% = Lot_CleanPath(NotesFromPath$)
  4585.         IF gDebugIsNotesOnPath%= 1 THEN PRINT "Notes program directory was found on the path and is set to :"+NotesFromPath$
  4586.         IsNotesOnPath = TRUE
  4587.     ELSE
  4588.         NotesFromPath$ = ""
  4589.         IsNotesOnPath = FALSE
  4590.     END IF
  4591.  
  4592.  
  4593. END FUNCTION
  4594.  
  4595. '*************************************************************************
  4596. '** FUNCTION IsNotesInLotusIni (NotesFromLotus$) AS INTEGER
  4597. '** Purpose:   Search for Notes entry in the in the Lotus.ini file
  4598. '**
  4599. '** RETURNS:    TRUE if found
  4600. '**
  4601. '** OUT symbols:
  4602. '**                     NotesFromLotus$    = location of Notes executables.
  4603. '**             
  4604. '**     
  4605. '** Author:  Michael Clark
  4606. '** Arguments:
  4607. '**     
  4608. '**     
  4609. '*************************************************************************
  4610. FUNCTION IsNotesInLotusIni (NotesFromLotus$) AS INTEGER
  4611. DIM rc%
  4612. DIM foundstr%
  4613.  
  4614.     IF gDebugNotesFromLotus = 1 THEN PRINT "Searching for notes using the Lotus.ini file"
  4615.     NotesFromLotus$ = LCASE$(GetIniKeyString(GetWindowsDir() + "lotus.ini","Lotus Applications","NOTES"))
  4616.  
  4617.     '** Verify that the file really exist, not just the path because the user may have
  4618.     '** moved or deleted Notes.
  4619. '**    rc% = DoesFileExist(gNotesProg$, 0)
  4620.     IF rc% = 1 THEN
  4621.         '' Strip "NOTES.EXE" from string
  4622.         foundstr% = INSTR(1,LCASE$(gNotesProg$),"\notes.exe")
  4623.         NotesFromLotus$ = MID$(NotesFromLotus$,1,(foundstr%-1))
  4624.         rc% = Lot_CleanPath(NotesFromLotus$)
  4625.         IF gDebugNotesFromLotus% = 1 THEN PRINT "Notes program Directory was found in Lotus.ini."
  4626.         IsNotesInLotusIni = TRUE
  4627.     ELSE
  4628.         IF gDebugNotesFromLotus% = 1 THEN PRINT "Notes program Directory was not found in Lotus.ini."
  4629.         NotesFromLotus$ = ""
  4630.         IsNotesInLotusIni = FALSE
  4631.     END IF        
  4632.  
  4633. END FUNCTION
  4634.  
  4635. '*************************************************************************
  4636. '** FUNCTION IsNotesInSessMgr (NotesFromLotus$) AS INTEGER
  4637. '** Purpose:   Search "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
  4638. '**                for Notes.ini
  4639. '** RETURNS:    TRUE if found
  4640. '**
  4641. '** OUT symbols:
  4642. '**                     NotesIniFromSessionMgr$    = location of Notes.ini
  4643. '**             
  4644. '**     
  4645. '** Author:  Michael Clark
  4646. '** Arguments:
  4647. '**     
  4648. '** NOTES:
  4649. '** for V3 we told the user to make this entry so the Notes.ini could be found on the path
  4650. '** so in V4 to find out if a NT V3 server has been installed query the registry looking
  4651. '** for the following key "SYSTEM\CurrentControlSet\Session Manager\Environment", this
  4652. '** Key should always be found. Then using the path setting in this key search for 
  4653. '** "notes.ini" on this path.
  4654. '** NOTES.INI WILL ALWAYS BE HONORED ON THE PATH.
  4655. '**     
  4656. '*************************************************************************
  4657. FUNCTION IsNotesInSessMgr(NotesIniFromSessionMgr$) AS INTEGER
  4658.     DIM szKey$            '** Registry key.
  4659.     DIM regStatus&        '** Return status from registry calls.
  4660.     DIM KeyBuffer$        '** String stored in registry.
  4661.     DIM KeyBufferLen&    '** Size of string returned.
  4662.  
  4663.     '** Verify that the Key exists before we do anything else, This key should always exist.
  4664.     szKey$ ="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
  4665.     IF gDebugNotesIniFromSessionMgr% = 1 THEN PRINT "Searching Session Manager key :"+szKey$+" for notes.ini"
  4666.  
  4667.     regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szkey$)
  4668.     IF regStatus&= 1 THEN        '** The key was found.
  4669.         '** Get the value of the PATH key from the registry entry.
  4670.         regStatus& =  Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, _
  4671.                                             szKey$, _
  4672.                                             "Path", _
  4673.                                             REG_EXPAND_SZ, _
  4674.                                             KeyBuffer$, _
  4675.                                             KeyBufferLen&) 
  4676.  
  4677.         '** See if the ini file exists on the path returned in KeyBuffer$
  4678.         NotesIniFromSessionMgr$ = DoesFileExistOnPath(KeyBuffer$, LdString(SID_NOT_NOTESINI))
  4679.         IF NotesIniFromSessionMgr$ <> "" THEN
  4680.             NotesIniFromSessionMgr$ = NotesIniFromSessionMgr$+"\"+LdString(SID_NOT_NOTESINI)
  4681.             IsNotesInSessMgr% = TRUE
  4682.         END IF
  4683.     ELSE                                '** The key wasn't found.
  4684.         IF gDebugNotesIniFromSessionMgr% = 1 THEN PRINT "Key  :"+STR$(regStatus)" Doesn't exist"
  4685.         IsNotesInSessMgr% = FALSE
  4686.     END IF    
  4687.  
  4688. END FUNCTION
  4689.  
  4690. '*************************************************************************
  4691. '** FUNCTION IsNotesIniOnPath(NotesIniFromPath$) AS INTEGER
  4692. '** Purpose:   Search the current PATH for "notes.ini"
  4693. '**
  4694. '** RETURNS:    TRUE if found
  4695. '**
  4696. '** OUT symbols:
  4697. '**                     NotesIniFromPath$    = location of Notes.ini
  4698. '**             
  4699. '**     
  4700. '** Author:  Michael Clark
  4701. '** Arguments:
  4702. '**     
  4703. '** NOTES.INI WILL ALWAYS BE HONORED ON THE PATH.
  4704. '**     
  4705. '*************************************************************************
  4706. FUNCTION IsNotesIniOnPath(NotesIniFromPath$) AS INTEGER
  4707.  
  4708.     '** See if the ini file exists on the path, if we find it on the path
  4709.     '** the get the Current KitType and Data Path.
  4710.  
  4711.     IF gDebugNotesFromPath = 1 THEN PRINT "Searching (PATH) for notes.ini"
  4712.     NotesIniFromPath$ =""
  4713.     NotesIniFromPath$ = FindTargetOnEnvVar(INIFILE$,"PATH")
  4714.     IF NotesIniFromPath$ <> "" THEN
  4715.         IF gDebugNotesIniFromPath% = 1 THEN PRINT "NotesIniFromPath Found on PATH statment "+NotesIniFromPath$
  4716.         IsNotesIniOnPath% = TRUE
  4717.     ELSE
  4718.         IsNotesIniOnPath% = FALSE
  4719.     END IF
  4720.  
  4721. END FUNCTION
  4722.  
  4723. '*************************************************************************
  4724. '** FUNCTION IsNotesIniInWinDir(NotesIniFromPath$) AS INTEGER
  4725. '** Purpose:   Search the current PATH for "notes.ini"
  4726. '**
  4727. '** RETURNS:    TRUE if found
  4728. '**
  4729. '** OUT symbols:
  4730. '**                     NotesIniFromPath$    = location of Notes.ini
  4731. '**             
  4732. '**     
  4733. '** Author:  Michael Clark
  4734. '** Arguments:
  4735. '**     
  4736. '** NOTES.INI WILL ALWAYS BE HONORED ON THE PATH.
  4737. '**     
  4738. '*************************************************************************
  4739. FUNCTION IsNotesIniInWinDir(NotesIniFromWinDir$) AS INTEGER
  4740.  
  4741.     IF gDebugNotesIniFromWinDir% = 1 THEN PRINT " Searching windows directory "GetWindowsDir()+INIFILE$+" for this file."
  4742.     IF  DoesFileExist(GetWindowsDir()+INIFILE$, 0) = 1 THEN
  4743.         NotesIniFromWinDir$ = GetWindowsDir()+INIFILE$
  4744.         IF gDebugNotesIniFromWinDir = 1 THEN PRINT "NotesIniFromSys Found in windows directory "+NotesIniFromWinDir$
  4745.         IsNotesIniInWinDir = TRUE
  4746.     ELSE
  4747.         IsNotesIniInWinDir = FALSE
  4748.     END IF
  4749. END FUNCTION
  4750.  
  4751. '*************************************************************************
  4752. '** FUNCTION GetPartitionInformation(NotesIniFromPath$) AS INTEGER
  4753. '** Purpose:   Search the current PATH for "notes.ini"
  4754. '**
  4755. '** RETURNS:    TRUE if found
  4756. '**
  4757. '** OUT symbols:
  4758. '**                     NotesIniFromPath$    = location of Notes.ini
  4759. '**             
  4760. '**     
  4761. '** Author:  Michael Clark
  4762. '** Arguments:
  4763. '**     
  4764. '** NOTES.INI WILL ALWAYS BE HONORED ON THE PATH.
  4765. '**     
  4766. '*************************************************************************
  4767. FUNCTION IsPartitonedInstall(PartitionProg$, PartitionData$)AS INTEGER
  4768.     DIM szKey$            '** Registry key.
  4769.     DIM szKey2$            '** Registry key.
  4770.     DIM KeyBuffer$        '** String stored in registry.
  4771.     DIM KeyBufferLen&    '** Size of string returned.
  4772.     DIM KeyBuffer2$        '** String stored in registry.
  4773.     DIM KeyBufferLen2&    '** Size of string returned.
  4774.     DIM Instance$        '** Instance of virtual server installed.
  4775.     DIM LastInstallPath$'** Location of Last virtual server install.
  4776.     DIM regStatus&
  4777.     DIM POS%
  4778.     KeyBuffer$ = String$(256,0)    '** Initialize storage
  4779.     KeyBufferLen& = CLNG(256)
  4780.     KeyBuffer2$ = String$(256,0)    '** Initialize storage
  4781.     KeyBufferLen2& = CLNG(256)
  4782.  
  4783.     '** Load up the registry key for Virtual Server Install and find out if it exists.
  4784.     szKey$ = gREGLOTUS+LdString(SID_NOT_NOTES_NAME)+LdString(SID_NOT_REG_VSERVER)
  4785.     if gDebugNotesPartition% = 1 THEN PRINT "Searching for registry key "+szKey$
  4786.     regStatus&= Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, szKey$)
  4787.  
  4788.     IF regStatus&= 1 THEN
  4789.         IF gDebugNotesPartition% = 1 THEN PRINT "The registry entry for Partioned servers '"+szKey$+"' exists so the virtual server is installed "
  4790.         '** VSERVER is installed so retrieve the previous values INSTANCE and the Program directory.
  4791.  
  4792.         regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "PATH", REG_SZ, KeyBuffer2$, KeyBufferLen2&)
  4793.         IF regStatus& = 0 THEN
  4794.             IF gDebugNotesPartition% = 1 THEN PRINT "The Key "+szKey$+"PATH exists so retrieve the instance value."
  4795.             PartitionProg$ = KeyBuffer2$
  4796.             IF gDebugNotes% = 1 OR gDebugNotesPartition% = 1 THEN PRINT "Partitioned server ProgDir is :"+KeyBuffer2$
  4797.         END IF
  4798.         regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szKey$, "INSTANCE", REG_SZ, KeyBuffer$, KeyBufferLen&)
  4799.         IF regStatus& = 0 THEN
  4800.             IF gDebugNotesPartition% = 1 THEN PRINT "The Key "+szKey$+"INSTANCE exists so retrieve the instance value."
  4801.             Instance$ = Lot_TrimEndSlash(NULLTRIM(KeyBuffer$))
  4802. '            Instance$ = MID$(Instance$,2,LEN(Instance$))
  4803.             IF gDebugNotes% = 1 OR gDebugNotesPartition% = 1 THEN PRINT "Last install instance of a partitioned server is :"+Instance$
  4804.  
  4805.             '** Retrieve the path from the last install 
  4806.             szkey2$ = szKey$+"\"+"1"
  4807.             regStatus&= Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey2$, "CLIENT"+Instance$, REG_SZ, KeyBuffer$, KeyBufferLen&)
  4808.             IF gDebugNotes% = 1 OR gDebugNotesPartition% = 1 THEN PRINT "Search for key "+szKey2$+" returned "+KeyBuffer$
  4809.             LastInstallPath$ = Lot_TrimEndSlash(NULLTRIM(KeyBuffer$))
  4810.             IF gDebugNotes% = 1 OR gDebugPartition% = 1 THEN PRINT "Last installed in Directory from registry was:"+LastInstallPath$
  4811.  
  4812.             '** If the instance is included in the path then increment the instance
  4813.             '** an setup the next suggested path. If the instance is not included in
  4814.             '** the path then just append the instance onto the previous path.
  4815.  
  4816.             '** Try and locate the instance in the last installed directory.
  4817.             IF gDebugNotes% = 1 OR gDebugNotesPartition% = 1 THEN PRINT "Searching LastInstalledPath "+LastInstallPath$+" for the instance :"+Instance$
  4818.             pos% = INSTR(LastInstallPath$,Instance$)        
  4819.             If pos% <> 0 THEN
  4820.                 '** Convert the instance to a number, increment by one and return a string.
  4821.                 Instance$ = MID$(STR$(VAL(Instance$)+1),2, LEN(STR$(VAL(Instance$)+1)))
  4822.                 IF gDebugNotesPartition% = 1 THEN PRINT "Next instance is :"+Instance$
  4823.                 LastInstallPath$ = Left$(LastInstallPath$, LEN(LastInstallPath$) - LEN(Instance$))
  4824.                 IF gDebugNotesPartition% = 1 THEN PRINT "Directory to append to :"+LastInstallPath$
  4825.                 LastInstallPath$ = LastInstallPath$+Instance$
  4826.             ELSE
  4827.                 Instance$ = MID$(STR$(VAL(Instance$)+1),2, LEN(STR$(VAL(Instance$)+1)))
  4828.                 LastInstallPath$ = NULLTRIM(LastInstallPath$)+Instance$
  4829.                 IF gDebugNotesPartition% = 1 THEN PRINT "Appended directory to last path :"+LastInstallPath$
  4830.             END IF
  4831.  
  4832.             IF gDebugNotesPartition% = 1 THEN PRINT "Setting Partitons ON because it's installed."
  4833.             IsPartitonedInstall% = TRUE
  4834.             PartitionData$ = LastInstallPath$
  4835.             
  4836.             gPartitioned% = 1
  4837.             gPartitionsInstalled% = 1
  4838.         ELSE
  4839.             IF gDebugNotesPartition% = 1 THEN PRINT "Turning OFF service grade install because the key."+szKey$+" was not found."
  4840.             IsPartitonedInstall% = FALSE
  4841.             gPartitioned% = 0
  4842.             gPartitionsInstalled% = 0
  4843.         END IF
  4844.     END IF
  4845. END FUNCTION
  4846.  
  4847. '*************************************************************************
  4848. '** FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4849. '**
  4850. '** Purpose: Lot_WhereIsFeature fails if the feature to find is not
  4851. '**     being copied in this particular session.  In a reinstallation
  4852. '**     situation, this is bad since some features will already be
  4853. '**     installed and we'd like to know where, even if we aren't installing
  4854. '**        them this time around.  This function give CIT a chance, and if
  4855. '**     it fails then it tries to find the location itself.
  4856. '** Author: TLB
  4857. '** Arguments:  As in Lot_WhereIsFeature
  4858. '** Returns:  The directory path
  4859. '*************************************************************************
  4860.  
  4861. FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
  4862.     DIM WhereIs$, chpt$, DestDir$, DestDirSym$
  4863.     WhereIs$ = Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$)
  4864.     IF WhereIs$ = "" THEN
  4865.         chpt$ = Lot_GetChapterFromKeyWord(featureId$)
  4866.         DestDirSym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
  4867.         DestDir$ = Lot_GetDestDirValueFromInstallIni(DestDirSym$)
  4868.         IF DoesFileExist(DestDir$ + filetolookfor$, femExists) THEN
  4869.             WhereIs$ = DestDir$
  4870.         END IF
  4871.     END IF
  4872.  
  4873.     LWP_WhereIsFeature = WhereIs$
  4874. END FUNCTION
  4875.  
  4876. '** SUB NetWareNotFoundCB (hDlg&, CtrlId%, Classes$, Inst%)
  4877. '**
  4878. '** Purpose: Query the user for the Novell Volume name
  4879. '**
  4880. '**            
  4881. '** Author:    Michael Clark
  4882. '** Arguments: Callback args
  4883. '** Returns:   NONE
  4884. '*************************************************************************
  4885. SUB NetWareNotFoundCB (hDlg&, CtrlId%, Classes$, Inst&)
  4886. DIM newproddir$, notused%, temp%, StrLen%, tmp$
  4887.  
  4888. '    print "No NetwareDrive Found, NOTNLMDIR is :"+GetSymbolValue("NOTNLMDIR")
  4889.  
  4890.    SELECT CASE Classes$
  4891.  
  4892.    CASE "__DLGINIT"
  4893.     '    set up dlgbox
  4894.         'print "No NetwareDrive Found, NOTNLMDIR is :"+GetSymbolValue("NOTNLMDIR")
  4895.         SetListItem "IDC_EDIT", 1, GetSymbolValue("NOTNLMDIR")
  4896.         SetListItem "IDC_EDIT", 2, ""
  4897.  
  4898.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT1)
  4899.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT2)
  4900.  
  4901.         AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
  4902.  
  4903.         AddListItem SYM_UPDATELIST$, "IDC_TEXT1"
  4904.         AddListItem SYM_UPDATELIST$, "IDC_TEXT2"
  4905.  
  4906.         AddListItem SYM_UPDATELIST$, "IDC_EDIT1"
  4907.         AddListItem SYM_UPDATELIST$, "IDC_EDIT2"
  4908.  
  4909.         IF LEN(GetListItem ("IDC_EDIT", 2)) < 1 THEN
  4910.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), FALSE)
  4911.         ELSE
  4912.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), TRUE)
  4913.         END IF
  4914.  
  4915.    CASE "IDC_LIST1"
  4916.  
  4917.    CASE "IDC_EDIT"
  4918.  
  4919.         If LEN(GetListItem ("IDC_EDIT", 2)) < 1 THEN
  4920.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), FALSE)
  4921.         ELSE
  4922.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), TRUE)
  4923.         END IF
  4924.  
  4925.    CASE "IDC_CANCEL"
  4926.  
  4927.    CASE "IDC_OK"
  4928.  
  4929.     IF GetListLength("IDC_EDIT") <> 0 Then
  4930.         '** Get the current directory setting
  4931.         tmp$ = GetSymbolValue("NOTNLMDIR")
  4932.         '** Get the entry the user made.
  4933.         gNlmDir$ = GetListItem("IDC_EDIT",2)
  4934.         '** See if the use suppliedthe trailing colon, if they did not add it.
  4935.         if INSTR(gNlmDir$,":") = 0 THEN gNlmDir$=gNlmDir$+":"
  4936.         '** Get the length of the current directory.
  4937.         StrLen% = LEN (tmp$)
  4938.         '** Search the current directory for the the colon.
  4939.         temp% = INSTR(tmp$, ":")
  4940.         gNlmDir$ = gNlmDir$+RIGHT$(tmp$,StrLen% - temp%)
  4941.         'PRINT "The gNlmDir is :"gNlmDir$
  4942.     END IF
  4943.         'print "the new product dir is: "+newproddir$
  4944.    CASE "IDC_HELP"
  4945.    CASE "IDC_EXIT"
  4946.    END SELECT   
  4947. END SUB
  4948.  
  4949. '** SUB SELECTVALIDNETWAREDRIVE (hDlg&, CtrlId%, Classes$, Inst&)
  4950. SUB SELECTVALIDNETWAREDRIVE (hDlg&, CtrlId%, Classes$, Inst&)
  4951. DIM newproddir$, notused%
  4952.  
  4953.    SELECT CASE Classes$
  4954.  
  4955.    CASE "__DLGINIT"
  4956.     '    set up dlgbox
  4957. '        print "No NetwareDrive Found"
  4958.         SetListItem "IDC_EDIT", 1, GetSymbolValue("NOTDIR")
  4959.         SetListItem "IDC_EDIT", 2, ""
  4960.  
  4961.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT1)
  4962.         AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT2)
  4963.  
  4964.         AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
  4965.  
  4966.         AddListItem SYM_UPDATELIST$, "IDC_TEXT1"
  4967.         AddListItem SYM_UPDATELIST$, "IDC_TEXT2"
  4968.  
  4969.         AddListItem SYM_UPDATELIST$, "IDC_EDIT1"
  4970.         AddListItem SYM_UPDATELIST$, "IDC_EDIT2"
  4971.  
  4972.         IF LEN(GetListItem ("IDC_EDIT", 2)) < 1 THEN
  4973.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), FALSE)
  4974.         ELSE
  4975.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), TRUE)
  4976.         END IF
  4977.  
  4978.    CASE "IDC_LIST1"
  4979.  
  4980.    CASE "IDC_EDIT"
  4981.  
  4982.         If LEN(GetListItem ("IDC_EDIT", 2)) < 1 THEN
  4983.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), FALSE)
  4984.         ELSE
  4985.             notused% = EnableWindow(GetDlgItem(hDlg&,IDC_OK), TRUE)
  4986.         END IF
  4987.  
  4988.    CASE "IDC_CANCEL"
  4989.  
  4990.    CASE "IDC_OK"
  4991.  
  4992.     if GetListLength("IDC_EDIT") <> 0 Then
  4993.         gNlmDir$ = GetListItem("IDC_EDIT",2)
  4994.     End If
  4995.         'print "the new product dir is: "+newproddir$
  4996.    CASE "IDC_HELP"
  4997.    CASE "IDC_EXIT"
  4998.    END SELECT   
  4999. END SUB
  5000.  
  5001. FUNCTION ValidateIni(IniFile$) AS INTEGER
  5002. DIM dum%, DestDir$, Result$, szVol$, Temp$
  5003.  
  5004.     ON ERROR GOTO NOINI
  5005.     '** Get the directory that DIRECTORY entry poinst to
  5006.     DestDir$ = Lot_TrimEndSlash(GetIniKeyString(IniFile$,"NOTES","Directory"))
  5007.     '** Check the directory for any valid notes templates.
  5008.     Result$ = DIR$ (DestDir$+"\pernames.ntf", 0)
  5009.  
  5010.     ON ERROR RESUME NEXT
  5011.  
  5012. NOINI:
  5013.     IF gDebugValidateIni% = 1 THEN PRINT "Result from DIR$("+DestDir$+"\*.ntf) is :"Result$
  5014.     dum% = Instr(1,Result$, "pernames.ntf",1)
  5015.     IF gDebugValidateIni% = 1 THEN PRINT "The search returned "+STR$(dum%)
  5016.  
  5017.     IF dum% = 0  THEN
  5018.         Result$ = LdString(SID_NOT_INIFOUND1)+IniFile$+LdString(SID_NOT_INIFOUND2)+LdString(SID_NOT_INIFOUND3)
  5019.         IF GetSymbolValue(SYM_AUTOMATIONINST$) = gFALSE$ THEN
  5020.             dum% = DoMsgBox(Result$, LdString(SID_NOT_NOTES_NAME),MB_YESNO+ MB_ICONQUESTION)
  5021.         ELSE
  5022.             ValidateIni = 2
  5023.         END IF
  5024.  
  5025.         IF dum% <> IDYES THEN
  5026.             ValidateIni = TRUE
  5027.         ELSE
  5028.             '** Strip the current extension
  5029.             dum% = InStr(1,IniFile$, ".ini",1)
  5030.             Temp$ = Left$(IniFile$,dum%)
  5031.             '** Save a copy of the file
  5032.             FileCopy IniFile$, Temp$+"bak"
  5033.             '** Delete the file.
  5034.             RemoveFile IniFile$, cmoNone
  5035.             ValidateIni = FALSE
  5036.         END IF
  5037.     ELSE
  5038.             ValidateIni = TRUE
  5039.     END IF
  5040.     RESUME DONE
  5041.  
  5042.  
  5043. DONE:
  5044.     EXIT FUNCTION
  5045.  
  5046. END FUNCTION
  5047.  
  5048.